# preprocess the input
input = input.upper()
input = input.strip()
# initialize the program counter
pc = 0
# initilize the stack
stack = []
# initilize the depth levels
depth = [({}, 0)]
# find the labels and methods
labels = {}
methods = {}
currIndex = 0
for line in input.split("\n"):
# look in the line for method headers and labels
m1 = re.match("\s*(\w+)\s+(\d+)\s+(\d+)\s*", line)
m2 = re.match("\s*\W*(\w+)\W*\s*", line)
# branch for methods, then labels
if m1:
arg = m1.groups()
methods[arg[0]] = (currIndex, arg[1], arg[2])
elif m2:
labels[m2.groups()[0]] = currIndex
# update the index
currIndex += 1
# error flag
error = False