diff --git a/src/main/java/dk/camelot64/kickc/Compiler.java b/src/main/java/dk/camelot64/kickc/Compiler.java index d28a2c9a4..71826b280 100644 --- a/src/main/java/dk/camelot64/kickc/Compiler.java +++ b/src/main/java/dk/camelot64/kickc/Compiler.java @@ -118,6 +118,7 @@ public class Compiler { getLog().append("INITIAL CONTROL FLOW GRAPH"); getLog().append(program.getGraph().toString(program)); + new Pass1AssertReturn(program).execute(); new Pass1AssertUsedVars(program).execute(); new Pass1ExtractInlineStrings(program).execute(); new Pass1EliminateUncalledProcedures(program).execute(); diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/aby=_hi_zpwo1.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/aby=_hi_zpwo1.asm new file mode 100644 index 000000000..c0879e4a7 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/aby=_hi_zpwo1.asm @@ -0,0 +1 @@ +lda {zpwo1}+1 \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/aby=_lo_zpwo1.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/aby=_lo_zpwo1.asm new file mode 100644 index 000000000..27e95a67c --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/aby=_lo_zpwo1.asm @@ -0,0 +1 @@ +lda {zpwo1} \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/aby=aby_ror_4.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/aby=aby_ror_4.asm new file mode 100644 index 000000000..a6cb3f23c --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/aby=aby_ror_4.asm @@ -0,0 +1,4 @@ +lsr +lsr +lsr +lsr \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=_word_zpptrby1.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=_word_zpptrby1.asm new file mode 100644 index 000000000..5ca034892 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=_word_zpptrby1.asm @@ -0,0 +1,4 @@ +lda {zpptrby1} +sta {zpwo1} +lda {zpptrby1}+1 +sta {zpwo1}+1 diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=coby1_setlo__deref_cowo2.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=coby1_setlo__deref_cowo2.asm new file mode 100644 index 000000000..fa27b918f --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=coby1_setlo__deref_cowo2.asm @@ -0,0 +1,4 @@ +lda {cowo2} +sta {zpwo1} +lda #0 +sta {zpwo1}+1 diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=zpwo1_sethi__deref_cowo1.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=zpwo1_sethi__deref_cowo1.asm new file mode 100644 index 000000000..598054b11 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=zpwo1_sethi__deref_cowo1.asm @@ -0,0 +1,2 @@ +lda {cowo1} +sta {zpwo1}+1 \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=zpwo2_sethi__deref_cowo1.asm b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=zpwo2_sethi__deref_cowo1.asm new file mode 100644 index 000000000..df88e0bde --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/asm/zpwo1=zpwo2_sethi__deref_cowo1.asm @@ -0,0 +1,4 @@ +lda {cowo1} +sta {zpwo1}+1 +lda {zpwo2} +sta {zpwo1} \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1AssertReturn.java b/src/main/java/dk/camelot64/kickc/passes/Pass1AssertReturn.java new file mode 100644 index 000000000..6709acc8b --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1AssertReturn.java @@ -0,0 +1,63 @@ +package dk.camelot64.kickc.passes; + +import dk.camelot64.kickc.model.*; + +import java.util.Collection; +import java.util.LinkedHashSet; + +/** + * Asserts that all control flow paths in a method with a defined return value ends at a return statement + */ +public class Pass1AssertReturn extends Pass1Base { + + public Pass1AssertReturn(Program program) { + super(program); + } + + @Override + public boolean executeStep() { + Collection allProcedures = getProgram().getScope().getAllProcedures(true); + for (Procedure procedure : allProcedures) { + if (procedure.getReturnType() != null && !SymbolType.VOID.equals(procedure.getReturnType())) { + LabelRef entryLabel = procedure.getRef().getLabelRef(); + ControlFlowBlock entryBlock = getProgram().getGraph().getBlock(entryLabel); + assertReturn(entryBlock, new LinkedHashSet<>()); + } + } + return false; + } + + /** + * Assert that all control flows end at a return statement. + * Follow the control flow of the graph recursively. + * + * @param block The block to examine + * @param visited Blocks already visited + */ + public void assertReturn(ControlFlowBlock block, Collection visited) { + if (visited.contains(block.getLabel())) { + return; + } + visited.add(block.getLabel()); + for (Statement statement : block.getStatements()) { + if (statement instanceof StatementAssignment) { + StatementAssignment assignment = (StatementAssignment) statement; + if(assignment.getlValue() instanceof VariableRef && ((VariableRef) assignment.getlValue()).getLocalName().equals("return")) { + // Happy days - return found! + return; + } + } else if (statement instanceof StatementConditionalJump) { + StatementConditionalJump cond = (StatementConditionalJump) statement; + ControlFlowBlock jumpTo = getProgram().getGraph().getBlock(cond.getDestination()); + assertReturn(jumpTo, visited); + } + } + ControlFlowBlock successor = getProgram().getGraph().getBlock(block.getDefaultSuccessor()); + if (successor == null || successor.getLabel().getLocalName().equals(SymbolRef.PROCEXIT_BLOCK_NAME)) { + throw new CompileError("Error! Method must end with a return statement. "+block.getScope().toString(getProgram())); + } else { + assertReturn(successor, visited); + } + } + +} diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1EliminateUncalledProcedures.java b/src/main/java/dk/camelot64/kickc/passes/Pass1EliminateUncalledProcedures.java index 75420e2da..0d98f11e4 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1EliminateUncalledProcedures.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1EliminateUncalledProcedures.java @@ -46,7 +46,7 @@ public class Pass1EliminateUncalledProcedures extends Pass1Base { procedure.getScope().remove(procedure); } - return false; + return unusedProcedures.size()>0; } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1TypeInference.java b/src/main/java/dk/camelot64/kickc/passes/Pass1TypeInference.java index bb3f8a629..23f6817ad 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1TypeInference.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1TypeInference.java @@ -52,6 +52,9 @@ public class Pass1TypeInference extends Pass1Base { LValue lValue = call.getlValue(); String procedureName = call.getProcedureName(); Procedure procedure = scopes.peek().getProcedure(procedureName); + if(procedure==null) { + throw new CompileError("Called procedure not found. "+call.toString(getProgram(), false)); + } call.setProcedure(procedure.getRef()); if(procedure.getParameters().size()!=call.getParameters().size()) { throw new CompileError("Wrong number of parameters in call. Expected " +procedure.getParameters().size()+". "+statement.toString()); diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass3PhiLifting.java b/src/main/java/dk/camelot64/kickc/passes/Pass3PhiLifting.java index 6e73dbb33..73658c6d8 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass3PhiLifting.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass3PhiLifting.java @@ -52,7 +52,10 @@ public class Pass3PhiLifting { newVar.setType(phiLValue.getType()); newVar.setInferredType(true); List predecessorStatements = predecessorBlock.getStatements(); - Statement lastPredecessorStatement = predecessorStatements.get(predecessorStatements.size() - 1); + Statement lastPredecessorStatement = null; + if(predecessorStatements.size()>0) { + lastPredecessorStatement = predecessorStatements.get(predecessorStatements.size() - 1); + } StatementAssignment newAssignment = new StatementAssignment(newVar, phiRValue.getrValue()); if (lastPredecessorStatement instanceof StatementConditionalJump) { // Use or Create a new block between the predecessor and this one - getReplacement labels where appropriate diff --git a/src/main/java/dk/camelot64/kickc/test/TestPrograms.java b/src/main/java/dk/camelot64/kickc/test/TestPrograms.java index fa79e2cf2..02f454c7c 100644 --- a/src/main/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/main/java/dk/camelot64/kickc/test/TestPrograms.java @@ -29,7 +29,7 @@ public class TestPrograms extends TestCase { } public void testBasicFloats() throws IOException, URISyntaxException { - compileAndCompare("basic-floats"); + compileAndCompare("sinus-basic"); } public void testDoubleImport() throws IOException, URISyntaxException { @@ -57,7 +57,7 @@ public class TestPrograms extends TestCase { } public void testPrint() throws IOException, URISyntaxException { - compileAndCompare("print"); + compileAndCompare("printmsg"); } public void testUnusedMethod() throws IOException, URISyntaxException { @@ -258,77 +258,53 @@ public class TestPrograms extends TestCase { } public void testAssignConst() throws IOException, URISyntaxException { - try { - compileAndCompare("assign-const"); - } catch (CompileError e) { - // expecting error! - return; - } - fail("Expected compile error."); + assertError("assign-const", "Constants can not be modified"); } public void testStmtOutsideMethod() throws IOException, URISyntaxException { - try { - compileAndCompare("stmt-outside-method"); - } catch (CompileError e) { - // expecting error! - return; - } - fail("Expected compile error."); + assertError("stmt-outside-method", "Error parsing"); } public void testUseUndeclared() throws IOException, URISyntaxException { - try { - compileAndCompare("useundeclared"); - } catch (CompileError e) { - // expecting error! - return; - } - fail("Expected compile error."); + assertError("useundeclared", "Unknown variable"); } public void testUseUninitialized() throws IOException, URISyntaxException { - try { - compileAndCompare("useuninitialized"); - } catch (CompileError e) { - // expecting error! - return; - } - fail("Expected compile error."); + assertError("useuninitialized", "Variable used before being defined"); } public void testTypeMismatch() throws IOException, URISyntaxException { - try { - compileAndCompare("typemismatch"); - } catch (CompileError e) { - // expecting error! - return; - } - fail("Expected compile error."); + assertError("typemismatch", "Type mismatch"); } public void testToManyParams() throws IOException, URISyntaxException { - try { - compileAndCompare("tomanyparams"); - } catch (CompileError e) { - // expecting error! - return; - } - fail("Expected compile error."); + assertError("tomanyparams", "Wrong number of parameters in call"); } public void testToFewParams() throws IOException, URISyntaxException { + assertError("tofewparams", "Wrong number of parameters in call"); + } + + public void testNoReturn() throws IOException, URISyntaxException { + assertError("noreturn", "Method must end with a return statement"); + } + + public void testProcedureNotFound() throws IOException, URISyntaxException { + assertError("procedurenotfound", "Called procedure not found"); + } + + private void assertError(String kcFile, String expectError) throws IOException, URISyntaxException { try { - compileAndCompare("tofewparams"); + compileAndCompare(kcFile); } catch (CompileError e) { // expecting error! + assertTrue("Error message expected '"+expectError+"' - was:"+e.getMessage(), e.getMessage().contains(expectError)); return; } fail("Expected compile error."); } - private void compileAndCompare(String filename) throws IOException, URISyntaxException { TestPrograms tester = new TestPrograms(); tester.testFile(filename); diff --git a/src/main/java/dk/camelot64/kickc/test/basic-floats.kc b/src/main/java/dk/camelot64/kickc/test/basic-floats.kc index b7a9f829c..5f87c9be2 100644 --- a/src/main/java/dk/camelot64/kickc/test/basic-floats.kc +++ b/src/main/java/dk/camelot64/kickc/test/basic-floats.kc @@ -1,19 +1,267 @@ +// Library wrapping the BASIC floating point functions +// See https://www.c64-wiki.com/wiki/Floating_point_arithmetic +// See http://www.pagetable.com/c64rom/c64rom_sc.html - -void main() { - +// FAC = word +// Set the FAC (floating point accumulator) to the integer value of a 16bit word +void setFAC(word w) { + const byte* lo = $fe; + const byte* hi = $ff; + *lo = w; // Load word register Y,A into FAC (floating point accumulator) asm { - lda #$55 - ldy #$aa + ldy $fe + lda $ff jsr $b391 } +} +// word = FAC +// Get the value of the FAC (floating point accumulator) as an integer 16bit word +// Destroys the value in the FAC in the process +word getFAC() { + const byte* lo = $fe; + const byte* hi = $ff; // Load FAC (floating point accumulator) integer part into word register Y,A asm { jsr $b1aa sty $fe sta $ff } + word w = 0; + w = *hi; + return w; +} -} \ No newline at end of file +// ARG = FAC +// Set the ARG (floating point argument) to the value of the FAC (floating point accumulator) +void setARGtoFAC() { + asm { + jsr $bc0f + } +} + +// FAC = ARG +// Set the FAC (floating point accumulator) to the value of the ARG (floating point argument) +void setFACtoARG() { + asm { + jsr $bbfc + } +} + +// Zeropage addresses used to hold lo/hi-bytes of addresses of float numbers in MEM +const byte* memLo = $fe; +const byte* memHi = $ff; + +// Prepare MEM pointers for operations using MEM +void prepareMEM(byte* mem) { + *memLo = mem; +} + +// MEM = FAC +// Stores the value of the FAC to memory +// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};) +void setMEMtoFAC(byte* mem) { + prepareMEM(mem); + asm { + ldx $fe + ldy $ff + jsr $bbd4 + } +} + +// FAC = MEM +// Set the FAC to value from MEM (float saved in memory) +// Reads 5 bytes +void setFACtoMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $bba2 + } +} + +// FAC = PI/2 +// Set the FAC to PI/2 +// Reads 5 bytes from the BASIC ROM +void setFACtoPIhalf() { + asm { + lda #$e0 + ldy #$e2 + jsr $bba2 + } +} + +// FAC = 2*PI +// Set the FAC to 2*PI +// Reads 5 bytes from the BASIC ROM +void setFACto2PI() { + asm { + lda #$e5 + ldy #$e2 + jsr $bba2 + } +} + +// ARG = MEM +// Load the ARG from memory +// Reads 5 bytes +void setARGtoMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $ba8c + } +} + +// FAC = MEM+FAC +// Set FAC to MEM (float saved in memory) plus FAC (float accumulator) +// Reads 5 bytes from memory +void addMEMtoFAC(byte* mem) { + prepareMEM(mem); + asm { + lda $fe //memLo + ldy $ff //memHi + jsr $b867 + } +} + +// FAC = ARG+FAC +// Add ARG (floating point argument) to FAC (floating point accumulator) +void addARGtoFAC() { + asm { + jsr $b86a + } +} + +// FAC = MEM-FAC +// Set FAC to MEM (float saved in memory) minus FAC (float accumulator) +// Reads 5 bytes from memory +void subFACfromMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $b850 + } +} + +// FAC = ARG-FAC +// Set FAC to ARG minus FAC +void subFACfromARG() { + asm { + jsr $b853 + } +} + +// FAC = MEM/FAC +// Set FAC to MEM (float saved in memory) divided by FAC (float accumulator) +// Reads 5 bytes from memory +void divMEMbyFAC(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $bb0f + } +} + +// FAC = MEM*FAC +// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator) +// Reads 5 bytes from memory +void mulFACbyMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $ba28 + } +} + +// FAC = MEM^FAC +// Set FAC to MEM (float saved in memory) raised to power of FAC (float accumulator) +// Reads 5 bytes from memory +void pwrMEMbyFAC(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $bf78 + } +} + +// FAC = int(FAC) +// Set FAC to integer part of the FAC - int(FAC) +// The integer part is defined as the next lower integer - like java floor() +void intFAC() { + asm { + jsr $bccc + } +} + +// FAC = sin(FAC) +// Set FAC to sinus of the FAC - sin(FAC) +// Sinus is calculated on radians (0-2*PI) +void sinFAC() { + asm { + jsr $e26b + } +} + +// FAC = cos(FAC) +// Set FAC to cosinus of the FAC - cos(FAC) +// Cosinus is calculated on radians (0-2*PI) +void cosFAC() { + asm { + jsr $e264 + } +} + +// FAC = tan(FAC) +// Set FAC to the tangens of FAC - tan(FAC) +// Tangens is calculated on radians (0-2*PI) +void tanFAC() { + asm { + jsr $e2b4 + } +} + +// FAC = atn(FAC) +// Set FAC to the arc tangens of FAC - atn(FAC) +// Arc Tangens is calculated on radians (0-2*PI) +void atnFAC() { + asm { + jsr $e303 + } +} + +// FAC = sqr(FAC) +// Set FAC to the square root of FAC - sqr(FAC) +void sqrFAC() { + asm { + jsr $bf71 + } +} + +// FAC = exp(FAC) +// Set FAC to the exponential function of FAC - exp(FAC) +// Exp is based on the natural logarithm e=2.71828183 +void expFAC() { + asm { + jsr $bfed + } +} + +// FAC = log(FAC) +// Set FAC to the logarithm of FAC - log(FAC) +// Log is based on the natural logarithm e=2.71828183 +void logFAC() { + asm { + jsr $b9ea + } +} diff --git a/src/main/java/dk/camelot64/kickc/test/noreturn.kc b/src/main/java/dk/camelot64/kickc/test/noreturn.kc new file mode 100644 index 000000000..17a56ac27 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/noreturn.kc @@ -0,0 +1,8 @@ +void main() { + byte b = get(); + byte* screen = $400; +} + +byte get() { + byte b = 4; +} \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/test/print.kc b/src/main/java/dk/camelot64/kickc/test/print.kc index bd33d4100..77a1884ad 100644 --- a/src/main/java/dk/camelot64/kickc/test/print.kc +++ b/src/main/java/dk/camelot64/kickc/test/print.kc @@ -1,17 +1,4 @@ -byte[] msg = "hello world! @"; -byte[] msg2 = "hello c64! @"; -byte[] msg3 = "hello 2017! @"; - -void main() { - print_str(msg); - print_ln(); - print_str(msg2); - print_ln(); - print_str(msg3); - print_ln(); -} - byte* line_cursor = $0400; byte* char_cursor = line_cursor; @@ -29,3 +16,24 @@ void print_ln() { } while (line_cursorw); + print_byte(>4]); + print_char(hextab[b&$f]); +} + +// Print a single char +void print_char(byte ch) { + *(char_cursor++) = ch; +} + diff --git a/src/main/java/dk/camelot64/kickc/test/printmsg.kc b/src/main/java/dk/camelot64/kickc/test/printmsg.kc new file mode 100644 index 000000000..3f8f29c36 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/printmsg.kc @@ -0,0 +1,14 @@ +import "print" + +byte[] msg = "hello world! @"; +byte[] msg2 = "hello c64! @"; +byte[] msg3 = "hello 2017! @"; + +void main() { + print_str(msg); + print_ln(); + print_str(msg2); + print_ln(); + print_str(msg3); + print_ln(); +} diff --git a/src/main/java/dk/camelot64/kickc/test/procedurenotfound.kc b/src/main/java/dk/camelot64/kickc/test/procedurenotfound.kc new file mode 100644 index 000000000..a41e106d7 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/procedurenotfound.kc @@ -0,0 +1,3 @@ +void main() { + testme(); +} \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/test/ref/print.cfg b/src/main/java/dk/camelot64/kickc/test/ref/print.cfg deleted file mode 100644 index aa2ad7b64..000000000 --- a/src/main/java/dk/camelot64/kickc/test/ref/print.cfg +++ /dev/null @@ -1,64 +0,0 @@ -@begin: scope:[] from - [0] phi() [ ] ( ) - to:@3 -@3: scope:[] from @begin - [1] phi() [ ] ( ) - [2] call main param-assignment [ ] ( ) - to:@end -@end: scope:[] from @3 - [3] phi() [ ] ( ) -main: scope:[main] from @3 - [4] phi() [ ] ( main:2 [ ] ) - [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) - to:main::@1 -main::@1: scope:[main] from main - [6] phi() [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) - [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) - to:main::@2 -main::@2: scope:[main] from main::@1 - [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) - [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) - to:main::@3 -main::@3: scope:[main] from main::@2 - [10] phi() [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) - [11] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) - to:main::@4 -main::@4: scope:[main] from main::@3 - [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) - [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) - to:main::@5 -main::@5: scope:[main] from main::@4 - [14] phi() [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) - [15] call print_ln param-assignment [ ] ( main:2 [ ] ) - to:main::@return -main::@return: scope:[main] from main::@5 - [16] return [ ] ( main:2 [ ] ) - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - [17] (byte*) line_cursor#19 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) print_ln::$0 main::@5/(byte*~) print_ln::$0 ) [ line_cursor#19 char_cursor#20 ] ( main:2::print_ln:7 [ line_cursor#19 char_cursor#20 ] main:2::print_ln:11 [ line_cursor#19 char_cursor#20 ] main:2::print_ln:15 [ line_cursor#19 char_cursor#20 ] ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - [18] (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#12 char_cursor#20 ] ( main:2::print_ln:7 [ line_cursor#12 char_cursor#20 ] main:2::print_ln:11 [ line_cursor#12 char_cursor#20 ] main:2::print_ln:15 [ line_cursor#12 char_cursor#20 ] ) - [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) - [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@1 - [21] return [ print_ln::$0 ] ( main:2::print_ln:7 [ print_ln::$0 ] main:2::print_ln:11 [ print_ln::$0 ] main:2::print_ln:15 [ print_ln::$0 ] ) - to:@return -print_str: scope:[print_str] from main main::@2 main::@4 - [22] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#33 main::@4/(byte*~) char_cursor#34 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) - [22] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - [23] (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - to:print_str::@return -print_str::@return: scope:[print_str] from print_str::@1 - [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) - to:@return -print_str::@2: scope:[print_str] from print_str::@1 - [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) - [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) - to:print_str::@1 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/print.asm b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.asm similarity index 100% rename from src/main/java/dk/camelot64/kickc/test/ref/print.asm rename to src/main/java/dk/camelot64/kickc/test/ref/printmsg.asm diff --git a/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg new file mode 100644 index 000000000..7d485ce47 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.cfg @@ -0,0 +1,64 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@3 +@3: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main param-assignment [ ] ( ) + to:@end +@end: scope:[] from @3 + [3] phi() [ ] ( ) +main: scope:[main] from @3 + [4] phi() [ ] ( main:2 [ ] ) + [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) + to:main::@1 +main::@1: scope:[main] from main + [6] phi() [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) + [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) + to:main::@2 +main::@2: scope:[main] from main::@1 + [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) + [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) + to:main::@3 +main::@3: scope:[main] from main::@2 + [10] phi() [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) + [11] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) + to:main::@4 +main::@4: scope:[main] from main::@3 + [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) + [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) + to:main::@5 +main::@5: scope:[main] from main::@4 + [14] phi() [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) + [15] call print_ln param-assignment [ ] ( main:2 [ ] ) + to:main::@return +main::@return: scope:[main] from main::@5 + [16] return [ ] ( main:2 [ ] ) + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + [17] (byte*) line_cursor#16 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) print_ln::$0 main::@5/(byte*~) print_ln::$0 ) [ line_cursor#16 char_cursor#13 ] ( main:2::print_ln:7 [ line_cursor#16 char_cursor#13 ] main:2::print_ln:11 [ line_cursor#16 char_cursor#13 ] main:2::print_ln:15 [ line_cursor#16 char_cursor#13 ] ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [18] (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#8 char_cursor#13 ] ( main:2::print_ln:7 [ line_cursor#8 char_cursor#13 ] main:2::print_ln:11 [ line_cursor#8 char_cursor#13 ] main:2::print_ln:15 [ line_cursor#8 char_cursor#13 ] ) + [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) + [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [21] return [ print_ln::$0 ] ( main:2::print_ln:7 [ print_ln::$0 ] main:2::print_ln:11 [ print_ln::$0 ] main:2::print_ln:15 [ print_ln::$0 ] ) + to:@return +print_str: scope:[print_str] from main main::@2 main::@4 + [22] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#34 main::@4/(byte*~) char_cursor#35 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) + [22] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + [23] (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + to:print_str::@return +print_str::@return: scope:[print_str] from print_str::@1 + [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) + to:@return +print_str::@2: scope:[print_str] from print_str::@1 + [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) + [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) + to:print_str::@1 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/print.log b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.log similarity index 57% rename from src/main/java/dk/camelot64/kickc/test/ref/print.log rename to src/main/java/dk/camelot64/kickc/test/ref/printmsg.log index f0c9b77b8..6bfe2ba3a 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/print.log +++ b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.log @@ -1,3 +1,4 @@ +import "print.kc" byte[] msg = "hello world! @"; byte[] msg2 = "hello c64! @"; @@ -12,6 +13,8 @@ void main() { print_ln(); } +Importing print.kc + byte* line_cursor = $0400; byte* char_cursor = line_cursor; @@ -33,19 +36,6 @@ void print_ln() { Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str PROGRAM - (byte[]) msg ← (string) "hello world! @" - (byte[]) msg2 ← (string) "hello c64! @" - (byte[]) msg3 ← (string) "hello 2017! @" -proc (void()) main() - (void~) main::$0 ← call print_str (byte[]) msg - (void~) main::$1 ← call print_ln - (void~) main::$2 ← call print_str (byte[]) msg2 - (void~) main::$3 ← call print_ln - (void~) main::$4 ← call print_str (byte[]) msg3 - (void~) main::$5 ← call print_ln -main::@return: - return -endproc // main() (byte*) line_cursor ← (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor proc (void()) print_str((byte*) print_str::str) @@ -72,6 +62,19 @@ print_ln::@1: print_ln::@return: return endproc // print_ln() + (byte[]) msg ← (string) "hello world! @" + (byte[]) msg2 ← (string) "hello c64! @" + (byte[]) msg3 ← (string) "hello 2017! @" +proc (void()) main() + (void~) main::$0 ← call print_str (byte[]) msg + (void~) main::$1 ← call print_ln + (void~) main::$2 ← call print_str (byte[]) msg2 + (void~) main::$3 ← call print_ln + (void~) main::$4 ← call print_str (byte[]) msg3 + (void~) main::$5 ← call print_ln +main::@return: + return +endproc // main() call main SYMBOLS @@ -104,25 +107,9 @@ SYMBOLS Promoting word/signed word to byte* in line_cursor ← ((byte*)) 1024 INITIAL CONTROL FLOW GRAPH @begin: scope:[] from - (byte[]) msg ← (string) "hello world! @" - (byte[]) msg2 ← (string) "hello c64! @" - (byte[]) msg3 ← (string) "hello 2017! @" - to:@1 -main: scope:[main] from - (void~) main::$0 ← call print_str (byte[]) msg - (void~) main::$1 ← call print_ln - (void~) main::$2 ← call print_str (byte[]) msg2 - (void~) main::$3 ← call print_ln - (void~) main::$4 ← call print_str (byte[]) msg3 - (void~) main::$5 ← call print_ln - to:main::@return -main::@return: scope:[main] from main - return - to:@return -@1: scope:[] from @begin (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor - to:@2 + to:@1 print_str: scope:[print_str] from to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 @@ -145,8 +132,8 @@ print_str::@6: scope:[print_str] from print_str::@return: scope:[print_str] from print_str::@3 return to:@return -@2: scope:[] from @1 - to:@3 +@1: scope:[] from @begin + to:@2 print_ln: scope:[print_ln] from to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 @@ -161,6 +148,22 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return +@2: scope:[] from @1 + (byte[]) msg ← (string) "hello world! @" + (byte[]) msg2 ← (string) "hello c64! @" + (byte[]) msg3 ← (string) "hello 2017! @" + to:@3 +main: scope:[main] from + (void~) main::$0 ← call print_str (byte[]) msg + (void~) main::$1 ← call print_ln + (void~) main::$2 ← call print_str (byte[]) msg2 + (void~) main::$3 ← call print_ln + (void~) main::$4 ← call print_str (byte[]) msg3 + (void~) main::$5 ← call print_ln + to:main::@return +main::@return: scope:[main] from main + return + to:@return @3: scope:[] from @2 call main to:@end @@ -176,28 +179,12 @@ Removing empty block print_str::@4 Removing empty block print_str::@3 Removing empty block print_str::@5 Removing empty block print_str::@6 -Removing empty block @2 +Removing empty block @1 CONTROL FLOW GRAPH @begin: scope:[] from - (byte[]) msg ← (string) "hello world! @" - (byte[]) msg2 ← (string) "hello c64! @" - (byte[]) msg3 ← (string) "hello 2017! @" - to:@1 -main: scope:[main] from - call print_str (byte[]) msg - call print_ln - call print_str (byte[]) msg2 - call print_ln - call print_str (byte[]) msg3 - call print_ln - to:main::@return -main::@return: scope:[main] from main - return - to:@return -@1: scope:[] from @begin (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 (byte*) char_cursor ← (byte*) line_cursor - to:@3 + to:@2 print_str: scope:[print_str] from to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 @@ -226,24 +213,75 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@3: scope:[] from @1 +@2: scope:[] from @begin + (byte[]) msg ← (string) "hello world! @" + (byte[]) msg2 ← (string) "hello c64! @" + (byte[]) msg3 ← (string) "hello 2017! @" + to:@3 +main: scope:[main] from + call print_str (byte[]) msg + call print_ln + call print_str (byte[]) msg2 + call print_ln + call print_str (byte[]) msg3 + call print_ln + to:main::@return +main::@return: scope:[main] from main + return + to:@return +@3: scope:[] from @2 call main to:@end @end: scope:[] from @3 PROCEDURE MODIFY VARIABLE ANALYSIS -main modifies char_cursor -main modifies line_cursor print_str modifies char_cursor print_ln modifies line_cursor print_ln modifies char_cursor +main modifies char_cursor +main modifies line_cursor CONTROL FLOW GRAPH WITH ASSIGNMENT CALL @begin: scope:[] from + (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor ← (byte*) line_cursor + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (boolean~) print_str::$0 ← *((byte*) print_str::str) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor) ← *((byte*) print_str::str) + (byte*) char_cursor ← ++ (byte*) char_cursor + (byte*) print_str::str ← ++ (byte*) print_str::str + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + (byte*) char_cursor ← (byte*) char_cursor + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*~) print_ln::$0 ← (byte*) line_cursor + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor < (byte*) char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) char_cursor ← (byte*) line_cursor + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) line_cursor ← (byte*) line_cursor + (byte*) char_cursor ← (byte*) char_cursor + return + to:@return +@2: scope:[] from @begin (byte[]) msg ← (string) "hello world! @" (byte[]) msg2 ← (string) "hello c64! @" (byte[]) msg3 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 (byte*) print_str::str ← (byte[]) msg call print_str param-assignment @@ -281,42 +319,7 @@ main::@return: scope:[main] from main::@6 (byte*) line_cursor ← (byte*) line_cursor return to:@return -@1: scope:[] from @begin - (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 - (byte*) char_cursor ← (byte*) line_cursor - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (boolean~) print_str::$0 ← *((byte*) print_str::str) != (byte) '@' - if((boolean~) print_str::$0) goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor) ← *((byte*) print_str::str) - (byte*) char_cursor ← ++ (byte*) char_cursor - (byte*) print_str::str ← ++ (byte*) print_str::str - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - (byte*) char_cursor ← (byte*) char_cursor - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*~) print_ln::$0 ← (byte*) line_cursor + (byte/signed byte/word/signed word) 40 - (byte*) line_cursor ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) line_cursor < (byte*) char_cursor - if((boolean~) print_ln::$1) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - (byte*) char_cursor ← (byte*) line_cursor - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - (byte*) line_cursor ← (byte*) line_cursor - (byte*) char_cursor ← (byte*) char_cursor - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 @@ -331,133 +334,131 @@ Completing Phi functions... Completing Phi functions... Completing Phi functions... Completing Phi functions... -Completing Phi functions... CONTROL FLOW GRAPH SSA @begin: scope:[] from + (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor#0 ← (byte*) line_cursor#0 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#6 main::@4/(byte*) char_cursor#8 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#25 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + (byte*) char_cursor#13 ← phi( print_str::@1/(byte*) char_cursor#25 ) + (byte*) print_str::str#5 ← phi( print_str::@1/(byte*) print_str::str#4 ) + *((byte*) char_cursor#13) ← *((byte*) print_str::str#5) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#5 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + (byte*) char_cursor#14 ← phi( print_str::@1/(byte*) char_cursor#25 ) + (byte*) char_cursor#2 ← (byte*) char_cursor#14 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) char_cursor#26 ← phi( main::@1/(byte*) char_cursor#5 main::@3/(byte*) char_cursor#7 main::@5/(byte*) char_cursor#9 ) + (byte*) line_cursor#16 ← phi( main::@1/(byte*) line_cursor#17 main::@3/(byte*) line_cursor#18 main::@5/(byte*) line_cursor#19 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#26 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) line_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor#1 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) line_cursor#9 ← phi( print_ln::@1/(byte*) line_cursor#1 ) + (byte*) char_cursor#3 ← (byte*) line_cursor#9 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) char_cursor#16 ← phi( print_ln::@2/(byte*) char_cursor#3 ) + (byte*) line_cursor#10 ← phi( print_ln::@2/(byte*) line_cursor#9 ) + (byte*) line_cursor#2 ← (byte*) line_cursor#10 + (byte*) char_cursor#4 ← (byte*) char_cursor#16 + return + to:@return +@2: scope:[] from @begin + (byte*) line_cursor#22 ← phi( @begin/(byte*) line_cursor#0 ) + (byte*) char_cursor#30 ← phi( @begin/(byte*) char_cursor#0 ) (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 (byte[]) msg3#5 ← phi( @3/(byte[]) msg3#6 ) (byte[]) msg2#3 ← phi( @3/(byte[]) msg2#4 ) (byte*) line_cursor#21 ← phi( @3/(byte*) line_cursor#20 ) - (byte*) char_cursor#25 ← phi( @3/(byte*) char_cursor#28 ) + (byte*) char_cursor#27 ← phi( @3/(byte*) char_cursor#28 ) (byte[]) msg#1 ← phi( @3/(byte[]) msg#2 ) - (byte*) print_str::str#0 ← (byte[]) msg#1 + (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main (byte[]) msg3#4 ← phi( main/(byte[]) msg3#5 ) (byte[]) msg2#2 ← phi( main/(byte[]) msg2#3 ) - (byte*) line_cursor#16 ← phi( main/(byte*) line_cursor#21 ) - (byte*) char_cursor#13 ← phi( main/(byte*) char_cursor#25 ) - (byte*) char_cursor#0 ← (byte*) char_cursor#13 + (byte*) line_cursor#17 ← phi( main/(byte*) line_cursor#21 ) + (byte*) char_cursor#17 ← phi( main/(byte*) char_cursor#27 ) + (byte*) char_cursor#5 ← (byte*) char_cursor#17 call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 (byte[]) msg3#3 ← phi( main::@1/(byte[]) msg3#4 ) (byte[]) msg2#1 ← phi( main::@1/(byte[]) msg2#2 ) - (byte*) char_cursor#14 ← phi( main::@1/(byte*) char_cursor#0 ) - (byte*) line_cursor#8 ← phi( main::@1/(byte*) line_cursor#16 ) - (byte*) line_cursor#0 ← (byte*) line_cursor#8 - (byte*) char_cursor#1 ← (byte*) char_cursor#14 - (byte*) print_str::str#1 ← (byte[]) msg2#1 + (byte*) char_cursor#18 ← phi( main::@1/(byte*) char_cursor#5 ) + (byte*) line_cursor#11 ← phi( main::@1/(byte*) line_cursor#17 ) + (byte*) line_cursor#3 ← (byte*) line_cursor#11 + (byte*) char_cursor#6 ← (byte*) char_cursor#18 + (byte*) print_str::str#2 ← (byte[]) msg2#1 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 (byte[]) msg3#2 ← phi( main::@2/(byte[]) msg3#3 ) - (byte*) line_cursor#17 ← phi( main::@2/(byte*) line_cursor#0 ) - (byte*) char_cursor#15 ← phi( main::@2/(byte*) char_cursor#1 ) - (byte*) char_cursor#2 ← (byte*) char_cursor#15 + (byte*) line_cursor#18 ← phi( main::@2/(byte*) line_cursor#3 ) + (byte*) char_cursor#19 ← phi( main::@2/(byte*) char_cursor#6 ) + (byte*) char_cursor#7 ← (byte*) char_cursor#19 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 (byte[]) msg3#1 ← phi( main::@3/(byte[]) msg3#2 ) - (byte*) char_cursor#16 ← phi( main::@3/(byte*) char_cursor#2 ) - (byte*) line_cursor#9 ← phi( main::@3/(byte*) line_cursor#17 ) - (byte*) line_cursor#1 ← (byte*) line_cursor#9 - (byte*) char_cursor#3 ← (byte*) char_cursor#16 - (byte*) print_str::str#2 ← (byte[]) msg3#1 + (byte*) char_cursor#20 ← phi( main::@3/(byte*) char_cursor#7 ) + (byte*) line_cursor#12 ← phi( main::@3/(byte*) line_cursor#18 ) + (byte*) line_cursor#4 ← (byte*) line_cursor#12 + (byte*) char_cursor#8 ← (byte*) char_cursor#20 + (byte*) print_str::str#3 ← (byte[]) msg3#1 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) line_cursor#18 ← phi( main::@4/(byte*) line_cursor#1 ) - (byte*) char_cursor#17 ← phi( main::@4/(byte*) char_cursor#3 ) - (byte*) char_cursor#4 ← (byte*) char_cursor#17 + (byte*) line_cursor#19 ← phi( main::@4/(byte*) line_cursor#4 ) + (byte*) char_cursor#21 ← phi( main::@4/(byte*) char_cursor#8 ) + (byte*) char_cursor#9 ← (byte*) char_cursor#21 call print_ln param-assignment to:main::@6 main::@6: scope:[main] from main::@5 - (byte*) char_cursor#18 ← phi( main::@5/(byte*) char_cursor#4 ) - (byte*) line_cursor#10 ← phi( main::@5/(byte*) line_cursor#18 ) - (byte*) line_cursor#2 ← (byte*) line_cursor#10 - (byte*) char_cursor#5 ← (byte*) char_cursor#18 + (byte*) char_cursor#22 ← phi( main::@5/(byte*) char_cursor#9 ) + (byte*) line_cursor#13 ← phi( main::@5/(byte*) line_cursor#19 ) + (byte*) line_cursor#5 ← (byte*) line_cursor#13 + (byte*) char_cursor#10 ← (byte*) char_cursor#22 to:main::@return main::@return: scope:[main] from main::@6 - (byte*) line_cursor#11 ← phi( main::@6/(byte*) line_cursor#2 ) - (byte*) char_cursor#19 ← phi( main::@6/(byte*) char_cursor#5 ) - (byte*) char_cursor#6 ← (byte*) char_cursor#19 - (byte*) line_cursor#3 ← (byte*) line_cursor#11 - return - to:@return -@1: scope:[] from @begin - (byte[]) msg3#7 ← phi( @begin/(byte[]) msg3#0 ) - (byte[]) msg2#5 ← phi( @begin/(byte[]) msg2#0 ) - (byte[]) msg#3 ← phi( @begin/(byte[]) msg#0 ) - (byte*) line_cursor#4 ← ((byte*)) (word/signed word) 1024 - (byte*) char_cursor#7 ← (byte*) line_cursor#4 - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#25 main::@2/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#3 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#26 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' - if((boolean~) print_str::$0) goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - (byte*) char_cursor#20 ← phi( print_str::@1/(byte*) char_cursor#26 ) - (byte*) print_str::str#5 ← phi( print_str::@1/(byte*) print_str::str#4 ) - *((byte*) char_cursor#20) ← *((byte*) print_str::str#5) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#5 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - (byte*) char_cursor#21 ← phi( print_str::@1/(byte*) char_cursor#26 ) - (byte*) char_cursor#9 ← (byte*) char_cursor#21 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) char_cursor#27 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#2 main::@5/(byte*) char_cursor#4 ) - (byte*) line_cursor#19 ← phi( main::@1/(byte*) line_cursor#16 main::@3/(byte*) line_cursor#17 main::@5/(byte*) line_cursor#18 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) char_cursor#22 ← phi( print_ln/(byte*) char_cursor#27 print_ln::@1/(byte*) char_cursor#22 ) - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) line_cursor#5 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) line_cursor#5 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) line_cursor#5 < (byte*) char_cursor#22 - if((boolean~) print_ln::$1) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - (byte*) line_cursor#13 ← phi( print_ln::@1/(byte*) line_cursor#5 ) - (byte*) char_cursor#10 ← (byte*) line_cursor#13 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - (byte*) char_cursor#23 ← phi( print_ln::@2/(byte*) char_cursor#10 ) - (byte*) line_cursor#14 ← phi( print_ln::@2/(byte*) line_cursor#13 ) - (byte*) line_cursor#6 ← (byte*) line_cursor#14 + (byte*) line_cursor#14 ← phi( main::@6/(byte*) line_cursor#5 ) + (byte*) char_cursor#23 ← phi( main::@6/(byte*) char_cursor#10 ) (byte*) char_cursor#11 ← (byte*) char_cursor#23 + (byte*) line_cursor#6 ← (byte*) line_cursor#14 return to:@return -@3: scope:[] from @1 - (byte[]) msg3#6 ← phi( @1/(byte[]) msg3#7 ) - (byte[]) msg2#4 ← phi( @1/(byte[]) msg2#5 ) - (byte*) line_cursor#20 ← phi( @1/(byte*) line_cursor#4 ) - (byte*) char_cursor#28 ← phi( @1/(byte*) char_cursor#7 ) - (byte[]) msg#2 ← phi( @1/(byte[]) msg#3 ) +@3: scope:[] from @2 + (byte[]) msg3#6 ← phi( @2/(byte[]) msg3#0 ) + (byte[]) msg2#4 ← phi( @2/(byte[]) msg2#0 ) + (byte*) line_cursor#20 ← phi( @2/(byte*) line_cursor#22 ) + (byte*) char_cursor#28 ← phi( @2/(byte*) char_cursor#30 ) + (byte[]) msg#2 ← phi( @2/(byte[]) msg#0 ) call main param-assignment to:@4 @4: scope:[] from @3 @@ -470,142 +471,141 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN @begin: scope:[] from + (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor#0 ← (byte*) line_cursor#0 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#6 main::@4/(byte*) char_cursor#8 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#25 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + (byte*) char_cursor#13 ← phi( print_str::@1/(byte*) char_cursor#25 ) + (byte*) print_str::str#5 ← phi( print_str::@1/(byte*) print_str::str#4 ) + *((byte*) char_cursor#13) ← *((byte*) print_str::str#5) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#5 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + (byte*) char_cursor#14 ← phi( print_str::@1/(byte*) char_cursor#25 ) + (byte*) char_cursor#2 ← (byte*) char_cursor#14 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) char_cursor#26 ← phi( main::@1/(byte*) char_cursor#5 main::@3/(byte*) char_cursor#7 main::@5/(byte*) char_cursor#9 ) + (byte*) line_cursor#16 ← phi( main::@1/(byte*) line_cursor#17 main::@3/(byte*) line_cursor#18 main::@5/(byte*) line_cursor#19 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#26 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) line_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor#1 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) line_cursor#9 ← phi( print_ln::@1/(byte*) line_cursor#1 ) + (byte*) char_cursor#3 ← (byte*) line_cursor#9 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) char_cursor#16 ← phi( print_ln::@2/(byte*) char_cursor#3 ) + (byte*) line_cursor#10 ← phi( print_ln::@2/(byte*) line_cursor#9 ) + (byte*) line_cursor#2 ← (byte*) line_cursor#10 + (byte*) char_cursor#4 ← (byte*) char_cursor#16 + return + to:@return +@2: scope:[] from @begin + (byte*) line_cursor#22 ← phi( @begin/(byte*) line_cursor#0 ) + (byte*) char_cursor#30 ← phi( @begin/(byte*) char_cursor#0 ) (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 (byte[]) msg3#5 ← phi( @3/(byte[]) msg3#6 ) (byte[]) msg2#3 ← phi( @3/(byte[]) msg2#4 ) (byte*) line_cursor#21 ← phi( @3/(byte*) line_cursor#20 ) - (byte*) char_cursor#25 ← phi( @3/(byte*) char_cursor#28 ) + (byte*) char_cursor#27 ← phi( @3/(byte*) char_cursor#28 ) (byte[]) msg#1 ← phi( @3/(byte[]) msg#2 ) - (byte*) print_str::str#0 ← (byte[]) msg#1 + (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main (byte[]) msg3#4 ← phi( main/(byte[]) msg3#5 ) (byte[]) msg2#2 ← phi( main/(byte[]) msg2#3 ) - (byte*) line_cursor#16 ← phi( main/(byte*) line_cursor#21 ) - (byte*) char_cursor#13 ← phi( main/(byte*) char_cursor#9 ) - (byte*) char_cursor#0 ← (byte*) char_cursor#13 + (byte*) line_cursor#17 ← phi( main/(byte*) line_cursor#21 ) + (byte*) char_cursor#17 ← phi( main/(byte*) char_cursor#2 ) + (byte*) char_cursor#5 ← (byte*) char_cursor#17 call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 (byte[]) msg3#3 ← phi( main::@1/(byte[]) msg3#4 ) (byte[]) msg2#1 ← phi( main::@1/(byte[]) msg2#2 ) - (byte*) char_cursor#14 ← phi( main::@1/(byte*) char_cursor#11 ) - (byte*) line_cursor#8 ← phi( main::@1/(byte*) line_cursor#6 ) - (byte*) line_cursor#0 ← (byte*) line_cursor#8 - (byte*) char_cursor#1 ← (byte*) char_cursor#14 - (byte*) print_str::str#1 ← (byte[]) msg2#1 + (byte*) char_cursor#18 ← phi( main::@1/(byte*) char_cursor#4 ) + (byte*) line_cursor#11 ← phi( main::@1/(byte*) line_cursor#2 ) + (byte*) line_cursor#3 ← (byte*) line_cursor#11 + (byte*) char_cursor#6 ← (byte*) char_cursor#18 + (byte*) print_str::str#2 ← (byte[]) msg2#1 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 (byte[]) msg3#2 ← phi( main::@2/(byte[]) msg3#3 ) - (byte*) line_cursor#17 ← phi( main::@2/(byte*) line_cursor#0 ) - (byte*) char_cursor#15 ← phi( main::@2/(byte*) char_cursor#9 ) - (byte*) char_cursor#2 ← (byte*) char_cursor#15 + (byte*) line_cursor#18 ← phi( main::@2/(byte*) line_cursor#3 ) + (byte*) char_cursor#19 ← phi( main::@2/(byte*) char_cursor#2 ) + (byte*) char_cursor#7 ← (byte*) char_cursor#19 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 (byte[]) msg3#1 ← phi( main::@3/(byte[]) msg3#2 ) - (byte*) char_cursor#16 ← phi( main::@3/(byte*) char_cursor#11 ) - (byte*) line_cursor#9 ← phi( main::@3/(byte*) line_cursor#6 ) - (byte*) line_cursor#1 ← (byte*) line_cursor#9 - (byte*) char_cursor#3 ← (byte*) char_cursor#16 - (byte*) print_str::str#2 ← (byte[]) msg3#1 + (byte*) char_cursor#20 ← phi( main::@3/(byte*) char_cursor#4 ) + (byte*) line_cursor#12 ← phi( main::@3/(byte*) line_cursor#2 ) + (byte*) line_cursor#4 ← (byte*) line_cursor#12 + (byte*) char_cursor#8 ← (byte*) char_cursor#20 + (byte*) print_str::str#3 ← (byte[]) msg3#1 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) line_cursor#18 ← phi( main::@4/(byte*) line_cursor#1 ) - (byte*) char_cursor#17 ← phi( main::@4/(byte*) char_cursor#9 ) - (byte*) char_cursor#4 ← (byte*) char_cursor#17 + (byte*) line_cursor#19 ← phi( main::@4/(byte*) line_cursor#4 ) + (byte*) char_cursor#21 ← phi( main::@4/(byte*) char_cursor#2 ) + (byte*) char_cursor#9 ← (byte*) char_cursor#21 call print_ln param-assignment to:main::@6 main::@6: scope:[main] from main::@5 - (byte*) char_cursor#18 ← phi( main::@5/(byte*) char_cursor#11 ) - (byte*) line_cursor#10 ← phi( main::@5/(byte*) line_cursor#6 ) - (byte*) line_cursor#2 ← (byte*) line_cursor#10 - (byte*) char_cursor#5 ← (byte*) char_cursor#18 + (byte*) char_cursor#22 ← phi( main::@5/(byte*) char_cursor#4 ) + (byte*) line_cursor#13 ← phi( main::@5/(byte*) line_cursor#2 ) + (byte*) line_cursor#5 ← (byte*) line_cursor#13 + (byte*) char_cursor#10 ← (byte*) char_cursor#22 to:main::@return main::@return: scope:[main] from main::@6 - (byte*) line_cursor#11 ← phi( main::@6/(byte*) line_cursor#2 ) - (byte*) char_cursor#19 ← phi( main::@6/(byte*) char_cursor#5 ) - (byte*) char_cursor#6 ← (byte*) char_cursor#19 - (byte*) line_cursor#3 ← (byte*) line_cursor#11 - return - to:@return -@1: scope:[] from @begin - (byte[]) msg3#7 ← phi( @begin/(byte[]) msg3#0 ) - (byte[]) msg2#5 ← phi( @begin/(byte[]) msg2#0 ) - (byte[]) msg#3 ← phi( @begin/(byte[]) msg#0 ) - (byte*) line_cursor#4 ← ((byte*)) (word/signed word) 1024 - (byte*) char_cursor#7 ← (byte*) line_cursor#4 - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#25 main::@2/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#3 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#26 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' - if((boolean~) print_str::$0) goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - (byte*) char_cursor#20 ← phi( print_str::@1/(byte*) char_cursor#26 ) - (byte*) print_str::str#5 ← phi( print_str::@1/(byte*) print_str::str#4 ) - *((byte*) char_cursor#20) ← *((byte*) print_str::str#5) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#5 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - (byte*) char_cursor#21 ← phi( print_str::@1/(byte*) char_cursor#26 ) - (byte*) char_cursor#9 ← (byte*) char_cursor#21 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) char_cursor#27 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#2 main::@5/(byte*) char_cursor#4 ) - (byte*) line_cursor#19 ← phi( main::@1/(byte*) line_cursor#16 main::@3/(byte*) line_cursor#17 main::@5/(byte*) line_cursor#18 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) char_cursor#22 ← phi( print_ln/(byte*) char_cursor#27 print_ln::@1/(byte*) char_cursor#22 ) - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) line_cursor#5 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) line_cursor#5 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) line_cursor#5 < (byte*) char_cursor#22 - if((boolean~) print_ln::$1) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - (byte*) line_cursor#13 ← phi( print_ln::@1/(byte*) line_cursor#5 ) - (byte*) char_cursor#10 ← (byte*) line_cursor#13 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - (byte*) char_cursor#23 ← phi( print_ln::@2/(byte*) char_cursor#10 ) - (byte*) line_cursor#14 ← phi( print_ln::@2/(byte*) line_cursor#13 ) - (byte*) line_cursor#6 ← (byte*) line_cursor#14 + (byte*) line_cursor#14 ← phi( main::@6/(byte*) line_cursor#5 ) + (byte*) char_cursor#23 ← phi( main::@6/(byte*) char_cursor#10 ) (byte*) char_cursor#11 ← (byte*) char_cursor#23 + (byte*) line_cursor#6 ← (byte*) line_cursor#14 return to:@return -@3: scope:[] from @1 - (byte[]) msg3#6 ← phi( @1/(byte[]) msg3#7 ) - (byte[]) msg2#4 ← phi( @1/(byte[]) msg2#5 ) - (byte*) line_cursor#20 ← phi( @1/(byte*) line_cursor#4 ) - (byte*) char_cursor#28 ← phi( @1/(byte*) char_cursor#7 ) - (byte[]) msg#2 ← phi( @1/(byte[]) msg#3 ) +@3: scope:[] from @2 + (byte[]) msg3#6 ← phi( @2/(byte[]) msg3#0 ) + (byte[]) msg2#4 ← phi( @2/(byte[]) msg2#0 ) + (byte*) line_cursor#20 ← phi( @2/(byte*) line_cursor#22 ) + (byte*) char_cursor#28 ← phi( @2/(byte*) char_cursor#30 ) + (byte[]) msg#2 ← phi( @2/(byte[]) msg#0 ) call main param-assignment to:@4 @4: scope:[] from @3 - (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#3 ) - (byte*) char_cursor#24 ← phi( @3/(byte*) char_cursor#6 ) + (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#6 ) + (byte*) char_cursor#24 ← phi( @3/(byte*) char_cursor#11 ) (byte*) char_cursor#12 ← (byte*) char_cursor#24 (byte*) line_cursor#7 ← (byte*) line_cursor#15 to:@end @end: scope:[] from @4 INITIAL SSA SYMBOL TABLE -(label) @1 +(label) @2 (label) @3 (label) @4 (label) @begin @@ -635,6 +635,7 @@ INITIAL SSA SYMBOL TABLE (byte*) char_cursor#28 (byte*) char_cursor#29 (byte*) char_cursor#3 +(byte*) char_cursor#30 (byte*) char_cursor#4 (byte*) char_cursor#5 (byte*) char_cursor#6 @@ -657,6 +658,7 @@ INITIAL SSA SYMBOL TABLE (byte*) line_cursor#2 (byte*) line_cursor#20 (byte*) line_cursor#21 +(byte*) line_cursor#22 (byte*) line_cursor#3 (byte*) line_cursor#4 (byte*) line_cursor#5 @@ -676,14 +678,12 @@ INITIAL SSA SYMBOL TABLE (byte[]) msg#0 (byte[]) msg#1 (byte[]) msg#2 -(byte[]) msg#3 (byte[]) msg2 (byte[]) msg2#0 (byte[]) msg2#1 (byte[]) msg2#2 (byte[]) msg2#3 (byte[]) msg2#4 -(byte[]) msg2#5 (byte[]) msg3 (byte[]) msg3#0 (byte[]) msg3#1 @@ -692,7 +692,6 @@ INITIAL SSA SYMBOL TABLE (byte[]) msg3#4 (byte[]) msg3#5 (byte[]) msg3#6 -(byte[]) msg3#7 (void()) print_ln() (byte*~) print_ln::$0 (boolean~) print_ln::$1 @@ -713,255 +712,212 @@ INITIAL SSA SYMBOL TABLE (byte*) print_str::str#5 (byte*) print_str::str#6 +Not aliassing across scopes: print_str::str#6 print_str::str#1 +Not aliassing across scopes: char_cursor#29 char_cursor#27 +Not aliassing across scopes: line_cursor#16 line_cursor#17 +Not aliassing across scopes: char_cursor#26 char_cursor#5 +Not aliassing across scopes: line_cursor#1 print_ln::$0 Not aliassing across scopes: msg#1 msg#2 -Not aliassing across scopes: char_cursor#25 char_cursor#28 +Not aliassing across scopes: char_cursor#27 char_cursor#28 Not aliassing across scopes: line_cursor#21 line_cursor#20 Not aliassing across scopes: msg2#3 msg2#4 Not aliassing across scopes: msg3#5 msg3#6 -Not aliassing across scopes: print_str::str#0 msg#1 -Not aliassing across scopes: char_cursor#13 char_cursor#9 -Not aliassing across scopes: line_cursor#8 line_cursor#6 -Not aliassing across scopes: char_cursor#14 char_cursor#11 -Not aliassing across scopes: print_str::str#1 msg2#1 -Not aliassing across scopes: char_cursor#15 char_cursor#9 -Not aliassing across scopes: line_cursor#9 line_cursor#6 -Not aliassing across scopes: char_cursor#16 char_cursor#11 -Not aliassing across scopes: print_str::str#2 msg3#1 -Not aliassing across scopes: char_cursor#17 char_cursor#9 -Not aliassing across scopes: line_cursor#10 line_cursor#6 -Not aliassing across scopes: char_cursor#18 char_cursor#11 -Not aliassing across scopes: print_str::str#6 print_str::str#0 -Not aliassing across scopes: char_cursor#29 char_cursor#25 -Not aliassing across scopes: line_cursor#19 line_cursor#16 -Not aliassing across scopes: char_cursor#27 char_cursor#0 -Not aliassing across scopes: line_cursor#5 print_ln::$0 -Not aliassing across scopes: char_cursor#24 char_cursor#6 -Not aliassing across scopes: line_cursor#15 line_cursor#3 -Alias candidate removed (byte*) line_cursor#4 -Alias candidate removed (byte*) char_cursor#10 -Alias (byte*) line_cursor#16 = (byte*) line_cursor#21 +Not aliassing across scopes: print_str::str#1 msg#1 +Not aliassing across scopes: char_cursor#17 char_cursor#2 +Not aliassing across scopes: line_cursor#11 line_cursor#2 +Not aliassing across scopes: char_cursor#18 char_cursor#4 +Not aliassing across scopes: print_str::str#2 msg2#1 +Not aliassing across scopes: char_cursor#19 char_cursor#2 +Not aliassing across scopes: line_cursor#12 line_cursor#2 +Not aliassing across scopes: char_cursor#20 char_cursor#4 +Not aliassing across scopes: print_str::str#3 msg3#1 +Not aliassing across scopes: char_cursor#21 char_cursor#2 +Not aliassing across scopes: line_cursor#13 line_cursor#2 +Not aliassing across scopes: char_cursor#22 char_cursor#4 +Not aliassing across scopes: char_cursor#24 char_cursor#11 +Not aliassing across scopes: line_cursor#15 line_cursor#6 +Alias candidate removed (byte*) line_cursor#0 +Alias candidate removed (byte*) line_cursor#22 +Alias candidate removed (byte*) char_cursor#3 +Alias (byte*) char_cursor#0 = (byte*) char_cursor#30 (byte*) char_cursor#28 (byte*) line_cursor#20 +Alias (byte*) print_str::str#4 = (byte*) print_str::str#5 +Alias (byte*) char_cursor#13 = (byte*) char_cursor#25 (byte*) char_cursor#14 (byte*) char_cursor#2 +Alias (byte*) char_cursor#16 = (byte*) line_cursor#9 (byte*) line_cursor#1 (byte*) line_cursor#10 (byte*) line_cursor#2 (byte*) char_cursor#4 +Alias (byte*) line_cursor#17 = (byte*) line_cursor#21 Alias (byte[]) msg2#1 = (byte[]) msg2#2 (byte[]) msg2#3 Alias (byte[]) msg3#1 = (byte[]) msg3#4 (byte[]) msg3#5 (byte[]) msg3#3 (byte[]) msg3#2 -Alias (byte*) char_cursor#0 = (byte*) char_cursor#13 -Alias (byte*) line_cursor#0 = (byte*) line_cursor#8 (byte*) line_cursor#17 -Alias (byte*) char_cursor#1 = (byte*) char_cursor#14 -Alias (byte*) char_cursor#15 = (byte*) char_cursor#2 -Alias (byte*) line_cursor#1 = (byte*) line_cursor#9 (byte*) line_cursor#18 -Alias (byte*) char_cursor#16 = (byte*) char_cursor#3 -Alias (byte*) char_cursor#17 = (byte*) char_cursor#4 -Alias (byte*) line_cursor#10 = (byte*) line_cursor#2 (byte*) line_cursor#11 (byte*) line_cursor#3 -Alias (byte*) char_cursor#18 = (byte*) char_cursor#5 (byte*) char_cursor#19 (byte*) char_cursor#6 -Alias (byte[]) msg#0 = (byte[]) msg#3 (byte[]) msg#2 -Alias (byte[]) msg2#0 = (byte[]) msg2#5 (byte[]) msg2#4 -Alias (byte[]) msg3#0 = (byte[]) msg3#7 (byte[]) msg3#6 -Alias (byte*) char_cursor#28 = (byte*) char_cursor#7 (byte*) line_cursor#20 -Alias (byte*) print_str::str#4 = (byte*) print_str::str#5 -Alias (byte*) char_cursor#20 = (byte*) char_cursor#26 (byte*) char_cursor#21 (byte*) char_cursor#9 -Alias (byte*) char_cursor#11 = (byte*) line_cursor#13 (byte*) line_cursor#5 (byte*) line_cursor#14 (byte*) char_cursor#23 (byte*) line_cursor#6 +Alias (byte*) char_cursor#17 = (byte*) char_cursor#5 +Alias (byte*) line_cursor#11 = (byte*) line_cursor#3 (byte*) line_cursor#18 +Alias (byte*) char_cursor#18 = (byte*) char_cursor#6 +Alias (byte*) char_cursor#19 = (byte*) char_cursor#7 +Alias (byte*) line_cursor#12 = (byte*) line_cursor#4 (byte*) line_cursor#19 +Alias (byte*) char_cursor#20 = (byte*) char_cursor#8 +Alias (byte*) char_cursor#21 = (byte*) char_cursor#9 +Alias (byte*) line_cursor#13 = (byte*) line_cursor#5 (byte*) line_cursor#14 (byte*) line_cursor#6 +Alias (byte*) char_cursor#10 = (byte*) char_cursor#22 (byte*) char_cursor#23 (byte*) char_cursor#11 +Alias (byte[]) msg#0 = (byte[]) msg#2 +Alias (byte[]) msg2#0 = (byte[]) msg2#4 +Alias (byte[]) msg3#0 = (byte[]) msg3#6 Alias (byte*) char_cursor#12 = (byte*) char_cursor#24 Alias (byte*) line_cursor#15 = (byte*) line_cursor#7 Succesful SSA optimization Pass2AliasElimination CONTROL FLOW GRAPH @begin: scope:[] from - (byte[]) msg#0 ← (string) "hello world! @" - (byte[]) msg2#0 ← (string) "hello c64! @" - (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 -main: scope:[main] from @3 - (byte[]) msg3#1 ← phi( @3/(byte[]) msg3#0 ) - (byte[]) msg2#1 ← phi( @3/(byte[]) msg2#0 ) - (byte*) line_cursor#16 ← phi( @3/(byte*) char_cursor#28 ) - (byte*) char_cursor#25 ← phi( @3/(byte*) char_cursor#28 ) - (byte[]) msg#1 ← phi( @3/(byte[]) msg#0 ) - (byte*) print_str::str#0 ← (byte[]) msg#1 - call print_str param-assignment - to:main::@1 -main::@1: scope:[main] from main - (byte*) char_cursor#0 ← phi( main/(byte*) char_cursor#20 ) - call print_ln param-assignment - to:main::@2 -main::@2: scope:[main] from main::@1 - (byte*) char_cursor#1 ← phi( main::@1/(byte*) char_cursor#11 ) - (byte*) line_cursor#0 ← phi( main::@1/(byte*) char_cursor#11 ) - (byte*) print_str::str#1 ← (byte[]) msg2#1 - call print_str param-assignment - to:main::@3 -main::@3: scope:[main] from main::@2 - (byte*) char_cursor#15 ← phi( main::@2/(byte*) char_cursor#20 ) - call print_ln param-assignment - to:main::@4 -main::@4: scope:[main] from main::@3 - (byte*) char_cursor#16 ← phi( main::@3/(byte*) char_cursor#11 ) - (byte*) line_cursor#1 ← phi( main::@3/(byte*) char_cursor#11 ) - (byte*) print_str::str#2 ← (byte[]) msg3#1 - call print_str param-assignment - to:main::@5 -main::@5: scope:[main] from main::@4 - (byte*) char_cursor#17 ← phi( main::@4/(byte*) char_cursor#20 ) - call print_ln param-assignment - to:main::@6 -main::@6: scope:[main] from main::@5 - (byte*) char_cursor#18 ← phi( main::@5/(byte*) char_cursor#11 ) - (byte*) line_cursor#10 ← phi( main::@5/(byte*) char_cursor#11 ) - to:main::@return -main::@return: scope:[main] from main::@6 - return - to:@return -@1: scope:[] from @begin - (byte*) line_cursor#4 ← ((byte*)) (word/signed word) 1024 - (byte*) char_cursor#28 ← (byte*) line_cursor#4 - to:@3 + (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor#0 ← (byte*) line_cursor#0 + to:@2 print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#25 main::@2/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#16 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#18 main::@4/(byte*) char_cursor#20 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' if((boolean~) print_str::$0) goto print_str::@2 to:print_str::@return print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 to:print_str::@1 print_str::@return: scope:[print_str] from print_str::@1 return to:@return print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) char_cursor#27 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#15 main::@5/(byte*) char_cursor#17 ) - (byte*) line_cursor#19 ← phi( main::@1/(byte*) line_cursor#16 main::@3/(byte*) line_cursor#0 main::@5/(byte*) line_cursor#1 ) + (byte*) char_cursor#26 ← phi( main::@1/(byte*) char_cursor#17 main::@3/(byte*) char_cursor#19 main::@5/(byte*) char_cursor#21 ) + (byte*) line_cursor#16 ← phi( main::@1/(byte*) line_cursor#17 main::@3/(byte*) line_cursor#11 main::@5/(byte*) line_cursor#12 ) to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) char_cursor#22 ← phi( print_ln/(byte*) char_cursor#27 print_ln::@1/(byte*) char_cursor#22 ) - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#11 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#11 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) char_cursor#11 < (byte*) char_cursor#22 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#26 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#16 < (byte*) char_cursor#15 if((boolean~) print_ln::$1) goto print_ln::@1 to:print_ln::@2 print_ln::@2: scope:[print_ln] from print_ln::@1 - (byte*) char_cursor#10 ← (byte*) char_cursor#11 + (byte*) char_cursor#3 ← (byte*) char_cursor#16 to:print_ln::@return print_ln::@return: scope:[print_ln] from print_ln::@2 - (byte*) char_cursor#11 ← phi( print_ln::@2/(byte*) char_cursor#10 ) + (byte*) char_cursor#16 ← phi( print_ln::@2/(byte*) char_cursor#3 ) return to:@return -@3: scope:[] from @1 - (byte*) char_cursor#28 ← phi( @1/(byte*) line_cursor#4 ) +@2: scope:[] from @begin + (byte*) line_cursor#22 ← phi( @begin/(byte*) line_cursor#0 ) + (byte[]) msg#0 ← (string) "hello world! @" + (byte[]) msg2#0 ← (string) "hello c64! @" + (byte[]) msg3#0 ← (string) "hello 2017! @" + to:@3 +main: scope:[main] from @3 + (byte[]) msg3#1 ← phi( @3/(byte[]) msg3#0 ) + (byte[]) msg2#1 ← phi( @3/(byte[]) msg2#0 ) + (byte*) line_cursor#17 ← phi( @3/(byte*) char_cursor#0 ) + (byte*) char_cursor#27 ← phi( @3/(byte*) char_cursor#0 ) + (byte[]) msg#1 ← phi( @3/(byte[]) msg#0 ) + (byte*) print_str::str#1 ← (byte[]) msg#1 + call print_str param-assignment + to:main::@1 +main::@1: scope:[main] from main + (byte*) char_cursor#17 ← phi( main/(byte*) char_cursor#13 ) + call print_ln param-assignment + to:main::@2 +main::@2: scope:[main] from main::@1 + (byte*) char_cursor#18 ← phi( main::@1/(byte*) char_cursor#16 ) + (byte*) line_cursor#11 ← phi( main::@1/(byte*) char_cursor#16 ) + (byte*) print_str::str#2 ← (byte[]) msg2#1 + call print_str param-assignment + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte*) char_cursor#19 ← phi( main::@2/(byte*) char_cursor#13 ) + call print_ln param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte*) char_cursor#20 ← phi( main::@3/(byte*) char_cursor#16 ) + (byte*) line_cursor#12 ← phi( main::@3/(byte*) char_cursor#16 ) + (byte*) print_str::str#3 ← (byte[]) msg3#1 + call print_str param-assignment + to:main::@5 +main::@5: scope:[main] from main::@4 + (byte*) char_cursor#21 ← phi( main::@4/(byte*) char_cursor#13 ) + call print_ln param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) char_cursor#10 ← phi( main::@5/(byte*) char_cursor#16 ) + (byte*) line_cursor#13 ← phi( main::@5/(byte*) char_cursor#16 ) + to:main::@return +main::@return: scope:[main] from main::@6 + return + to:@return +@3: scope:[] from @2 + (byte*) char_cursor#0 ← phi( @2/(byte*) line_cursor#22 ) call main param-assignment to:@4 @4: scope:[] from @3 - (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#10 ) - (byte*) char_cursor#12 ← phi( @3/(byte*) char_cursor#18 ) + (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#13 ) + (byte*) char_cursor#12 ← phi( @3/(byte*) char_cursor#10 ) to:@end @end: scope:[] from @4 +Not aliassing across scopes: print_str::str#6 print_str::str#1 +Not aliassing across scopes: char_cursor#29 char_cursor#27 +Not aliassing across scopes: line_cursor#16 line_cursor#17 +Not aliassing across scopes: char_cursor#26 char_cursor#17 +Not aliassing across scopes: char_cursor#16 print_ln::$0 Not aliassing across scopes: msg#1 msg#0 -Not aliassing across scopes: char_cursor#25 char_cursor#28 -Not aliassing across scopes: line_cursor#16 char_cursor#28 +Not aliassing across scopes: char_cursor#27 char_cursor#0 +Not aliassing across scopes: line_cursor#17 char_cursor#0 Not aliassing across scopes: msg2#1 msg2#0 Not aliassing across scopes: msg3#1 msg3#0 -Not aliassing across scopes: print_str::str#0 msg#1 -Not aliassing across scopes: char_cursor#0 char_cursor#20 -Not aliassing across scopes: line_cursor#0 char_cursor#11 -Not aliassing across scopes: char_cursor#1 char_cursor#11 -Not aliassing across scopes: print_str::str#1 msg2#1 -Not aliassing across scopes: char_cursor#15 char_cursor#20 -Not aliassing across scopes: line_cursor#1 char_cursor#11 -Not aliassing across scopes: char_cursor#16 char_cursor#11 -Not aliassing across scopes: print_str::str#2 msg3#1 -Not aliassing across scopes: char_cursor#17 char_cursor#20 -Not aliassing across scopes: line_cursor#10 char_cursor#11 -Not aliassing across scopes: char_cursor#18 char_cursor#11 -Not aliassing across scopes: print_str::str#6 print_str::str#0 -Not aliassing across scopes: char_cursor#29 char_cursor#25 -Not aliassing across scopes: line_cursor#19 line_cursor#16 -Not aliassing across scopes: char_cursor#27 char_cursor#0 -Not aliassing across scopes: char_cursor#11 print_ln::$0 -Not aliassing across scopes: char_cursor#12 char_cursor#18 -Not aliassing across scopes: line_cursor#15 line_cursor#10 -Alias (byte*) char_cursor#28 = (byte*) line_cursor#4 -Alias (byte*) char_cursor#10 = (byte*) char_cursor#11 +Not aliassing across scopes: print_str::str#1 msg#1 +Not aliassing across scopes: char_cursor#17 char_cursor#13 +Not aliassing across scopes: line_cursor#11 char_cursor#16 +Not aliassing across scopes: char_cursor#18 char_cursor#16 +Not aliassing across scopes: print_str::str#2 msg2#1 +Not aliassing across scopes: char_cursor#19 char_cursor#13 +Not aliassing across scopes: line_cursor#12 char_cursor#16 +Not aliassing across scopes: char_cursor#20 char_cursor#16 +Not aliassing across scopes: print_str::str#3 msg3#1 +Not aliassing across scopes: char_cursor#21 char_cursor#13 +Not aliassing across scopes: line_cursor#13 char_cursor#16 +Not aliassing across scopes: char_cursor#10 char_cursor#16 +Not aliassing across scopes: char_cursor#12 char_cursor#10 +Not aliassing across scopes: line_cursor#15 line_cursor#13 +Alias (byte*) char_cursor#0 = (byte*) line_cursor#0 (byte*) line_cursor#22 +Alias (byte*) char_cursor#16 = (byte*) char_cursor#3 Succesful SSA optimization Pass2AliasElimination CONTROL FLOW GRAPH @begin: scope:[] from - (byte[]) msg#0 ← (string) "hello world! @" - (byte[]) msg2#0 ← (string) "hello c64! @" - (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 -main: scope:[main] from @3 - (byte[]) msg3#1 ← phi( @3/(byte[]) msg3#0 ) - (byte[]) msg2#1 ← phi( @3/(byte[]) msg2#0 ) - (byte*) line_cursor#16 ← phi( @3/(byte*) char_cursor#28 ) - (byte*) char_cursor#25 ← phi( @3/(byte*) char_cursor#28 ) - (byte[]) msg#1 ← phi( @3/(byte[]) msg#0 ) - (byte*) print_str::str#0 ← (byte[]) msg#1 - call print_str param-assignment - to:main::@1 -main::@1: scope:[main] from main - (byte*) char_cursor#0 ← phi( main/(byte*) char_cursor#20 ) - call print_ln param-assignment - to:main::@2 -main::@2: scope:[main] from main::@1 - (byte*) char_cursor#1 ← phi( main::@1/(byte*) char_cursor#10 ) - (byte*) line_cursor#0 ← phi( main::@1/(byte*) char_cursor#10 ) - (byte*) print_str::str#1 ← (byte[]) msg2#1 - call print_str param-assignment - to:main::@3 -main::@3: scope:[main] from main::@2 - (byte*) char_cursor#15 ← phi( main::@2/(byte*) char_cursor#20 ) - call print_ln param-assignment - to:main::@4 -main::@4: scope:[main] from main::@3 - (byte*) char_cursor#16 ← phi( main::@3/(byte*) char_cursor#10 ) - (byte*) line_cursor#1 ← phi( main::@3/(byte*) char_cursor#10 ) - (byte*) print_str::str#2 ← (byte[]) msg3#1 - call print_str param-assignment - to:main::@5 -main::@5: scope:[main] from main::@4 - (byte*) char_cursor#17 ← phi( main::@4/(byte*) char_cursor#20 ) - call print_ln param-assignment - to:main::@6 -main::@6: scope:[main] from main::@5 - (byte*) char_cursor#18 ← phi( main::@5/(byte*) char_cursor#10 ) - (byte*) line_cursor#10 ← phi( main::@5/(byte*) char_cursor#10 ) - to:main::@return -main::@return: scope:[main] from main::@6 - return - to:@return -@1: scope:[] from @begin - (byte*) char_cursor#28 ← ((byte*)) (word/signed word) 1024 - to:@3 + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@2 print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#25 main::@2/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#16 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#18 main::@4/(byte*) char_cursor#20 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' if((boolean~) print_str::$0) goto print_str::@2 to:print_str::@return print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 to:print_str::@1 print_str::@return: scope:[print_str] from print_str::@1 return to:@return print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) char_cursor#27 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#15 main::@5/(byte*) char_cursor#17 ) - (byte*) line_cursor#19 ← phi( main::@1/(byte*) line_cursor#16 main::@3/(byte*) line_cursor#0 main::@5/(byte*) line_cursor#1 ) + (byte*) char_cursor#26 ← phi( main::@1/(byte*) char_cursor#17 main::@3/(byte*) char_cursor#19 main::@5/(byte*) char_cursor#21 ) + (byte*) line_cursor#16 ← phi( main::@1/(byte*) line_cursor#17 main::@3/(byte*) line_cursor#11 main::@5/(byte*) line_cursor#12 ) to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) char_cursor#22 ← phi( print_ln/(byte*) char_cursor#27 print_ln::@1/(byte*) char_cursor#22 ) - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) char_cursor#10 < (byte*) char_cursor#22 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#26 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#16 < (byte*) char_cursor#15 if((boolean~) print_ln::$1) goto print_ln::@1 to:print_ln::@2 print_ln::@2: scope:[print_ln] from print_ln::@1 @@ -969,174 +925,256 @@ print_ln::@2: scope:[print_ln] from print_ln::@1 print_ln::@return: scope:[print_ln] from print_ln::@2 return to:@return -@3: scope:[] from @1 +@2: scope:[] from @begin + (byte[]) msg#0 ← (string) "hello world! @" + (byte[]) msg2#0 ← (string) "hello c64! @" + (byte[]) msg3#0 ← (string) "hello 2017! @" + to:@3 +main: scope:[main] from @3 + (byte[]) msg3#1 ← phi( @3/(byte[]) msg3#0 ) + (byte[]) msg2#1 ← phi( @3/(byte[]) msg2#0 ) + (byte*) line_cursor#17 ← phi( @3/(byte*) char_cursor#0 ) + (byte*) char_cursor#27 ← phi( @3/(byte*) char_cursor#0 ) + (byte[]) msg#1 ← phi( @3/(byte[]) msg#0 ) + (byte*) print_str::str#1 ← (byte[]) msg#1 + call print_str param-assignment + to:main::@1 +main::@1: scope:[main] from main + (byte*) char_cursor#17 ← phi( main/(byte*) char_cursor#13 ) + call print_ln param-assignment + to:main::@2 +main::@2: scope:[main] from main::@1 + (byte*) char_cursor#18 ← phi( main::@1/(byte*) char_cursor#16 ) + (byte*) line_cursor#11 ← phi( main::@1/(byte*) char_cursor#16 ) + (byte*) print_str::str#2 ← (byte[]) msg2#1 + call print_str param-assignment + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte*) char_cursor#19 ← phi( main::@2/(byte*) char_cursor#13 ) + call print_ln param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte*) char_cursor#20 ← phi( main::@3/(byte*) char_cursor#16 ) + (byte*) line_cursor#12 ← phi( main::@3/(byte*) char_cursor#16 ) + (byte*) print_str::str#3 ← (byte[]) msg3#1 + call print_str param-assignment + to:main::@5 +main::@5: scope:[main] from main::@4 + (byte*) char_cursor#21 ← phi( main::@4/(byte*) char_cursor#13 ) + call print_ln param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) char_cursor#10 ← phi( main::@5/(byte*) char_cursor#16 ) + (byte*) line_cursor#13 ← phi( main::@5/(byte*) char_cursor#16 ) + to:main::@return +main::@return: scope:[main] from main::@6 + return + to:@return +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 - (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#10 ) - (byte*) char_cursor#12 ← phi( @3/(byte*) char_cursor#18 ) + (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#13 ) + (byte*) char_cursor#12 ← phi( @3/(byte*) char_cursor#10 ) to:@end @end: scope:[] from @4 +Not aliassing across scopes: print_str::str#6 print_str::str#1 +Not aliassing across scopes: char_cursor#29 char_cursor#27 +Not aliassing across scopes: line_cursor#16 line_cursor#17 +Not aliassing across scopes: char_cursor#26 char_cursor#17 +Not aliassing across scopes: char_cursor#16 print_ln::$0 Not aliassing across scopes: msg#1 msg#0 -Not aliassing across scopes: char_cursor#25 char_cursor#28 -Not aliassing across scopes: line_cursor#16 char_cursor#28 +Not aliassing across scopes: char_cursor#27 char_cursor#0 +Not aliassing across scopes: line_cursor#17 char_cursor#0 Not aliassing across scopes: msg2#1 msg2#0 Not aliassing across scopes: msg3#1 msg3#0 -Not aliassing across scopes: print_str::str#0 msg#1 -Not aliassing across scopes: char_cursor#0 char_cursor#20 -Not aliassing across scopes: line_cursor#0 char_cursor#10 -Not aliassing across scopes: char_cursor#1 char_cursor#10 -Not aliassing across scopes: print_str::str#1 msg2#1 -Not aliassing across scopes: char_cursor#15 char_cursor#20 -Not aliassing across scopes: line_cursor#1 char_cursor#10 -Not aliassing across scopes: char_cursor#16 char_cursor#10 -Not aliassing across scopes: print_str::str#2 msg3#1 -Not aliassing across scopes: char_cursor#17 char_cursor#20 -Not aliassing across scopes: line_cursor#10 char_cursor#10 -Not aliassing across scopes: char_cursor#18 char_cursor#10 -Not aliassing across scopes: print_str::str#6 print_str::str#0 -Not aliassing across scopes: char_cursor#29 char_cursor#25 -Not aliassing across scopes: line_cursor#19 line_cursor#16 -Not aliassing across scopes: char_cursor#27 char_cursor#0 -Not aliassing across scopes: char_cursor#10 print_ln::$0 -Not aliassing across scopes: char_cursor#12 char_cursor#18 -Not aliassing across scopes: line_cursor#15 line_cursor#10 -Self Phi Eliminated (byte*) char_cursor#22 +Not aliassing across scopes: print_str::str#1 msg#1 +Not aliassing across scopes: char_cursor#17 char_cursor#13 +Not aliassing across scopes: line_cursor#11 char_cursor#16 +Not aliassing across scopes: char_cursor#18 char_cursor#16 +Not aliassing across scopes: print_str::str#2 msg2#1 +Not aliassing across scopes: char_cursor#19 char_cursor#13 +Not aliassing across scopes: line_cursor#12 char_cursor#16 +Not aliassing across scopes: char_cursor#20 char_cursor#16 +Not aliassing across scopes: print_str::str#3 msg3#1 +Not aliassing across scopes: char_cursor#21 char_cursor#13 +Not aliassing across scopes: line_cursor#13 char_cursor#16 +Not aliassing across scopes: char_cursor#10 char_cursor#16 +Not aliassing across scopes: char_cursor#12 char_cursor#10 +Not aliassing across scopes: line_cursor#15 line_cursor#13 +Self Phi Eliminated (byte*) char_cursor#15 Succesful SSA optimization Pass2SelfPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#27 main::@2/(byte*) char_cursor#18 main::@4/(byte*) char_cursor#20 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) char_cursor#26 ← phi( main::@1/(byte*) char_cursor#17 main::@3/(byte*) char_cursor#19 main::@5/(byte*) char_cursor#21 ) + (byte*) line_cursor#16 ← phi( main::@1/(byte*) line_cursor#17 main::@3/(byte*) line_cursor#11 main::@5/(byte*) line_cursor#12 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#26 ) + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#16 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 (byte[]) msg3#1 ← phi( @3/(byte[]) msg3#0 ) (byte[]) msg2#1 ← phi( @3/(byte[]) msg2#0 ) - (byte*) line_cursor#16 ← phi( @3/(byte*) char_cursor#28 ) - (byte*) char_cursor#25 ← phi( @3/(byte*) char_cursor#28 ) + (byte*) line_cursor#17 ← phi( @3/(byte*) char_cursor#0 ) + (byte*) char_cursor#27 ← phi( @3/(byte*) char_cursor#0 ) (byte[]) msg#1 ← phi( @3/(byte[]) msg#0 ) - (byte*) print_str::str#0 ← (byte[]) msg#1 + (byte*) print_str::str#1 ← (byte[]) msg#1 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main - (byte*) char_cursor#0 ← phi( main/(byte*) char_cursor#20 ) + (byte*) char_cursor#17 ← phi( main/(byte*) char_cursor#13 ) call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) char_cursor#1 ← phi( main::@1/(byte*) char_cursor#10 ) - (byte*) line_cursor#0 ← phi( main::@1/(byte*) char_cursor#10 ) - (byte*) print_str::str#1 ← (byte[]) msg2#1 + (byte*) char_cursor#18 ← phi( main::@1/(byte*) char_cursor#16 ) + (byte*) line_cursor#11 ← phi( main::@1/(byte*) char_cursor#16 ) + (byte*) print_str::str#2 ← (byte[]) msg2#1 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 - (byte*) char_cursor#15 ← phi( main::@2/(byte*) char_cursor#20 ) + (byte*) char_cursor#19 ← phi( main::@2/(byte*) char_cursor#13 ) call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) char_cursor#16 ← phi( main::@3/(byte*) char_cursor#10 ) - (byte*) line_cursor#1 ← phi( main::@3/(byte*) char_cursor#10 ) - (byte*) print_str::str#2 ← (byte[]) msg3#1 + (byte*) char_cursor#20 ← phi( main::@3/(byte*) char_cursor#16 ) + (byte*) line_cursor#12 ← phi( main::@3/(byte*) char_cursor#16 ) + (byte*) print_str::str#3 ← (byte[]) msg3#1 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) char_cursor#17 ← phi( main::@4/(byte*) char_cursor#20 ) + (byte*) char_cursor#21 ← phi( main::@4/(byte*) char_cursor#13 ) call print_ln param-assignment to:main::@6 main::@6: scope:[main] from main::@5 - (byte*) char_cursor#18 ← phi( main::@5/(byte*) char_cursor#10 ) - (byte*) line_cursor#10 ← phi( main::@5/(byte*) char_cursor#10 ) + (byte*) char_cursor#10 ← phi( main::@5/(byte*) char_cursor#16 ) + (byte*) line_cursor#13 ← phi( main::@5/(byte*) char_cursor#16 ) to:main::@return main::@return: scope:[main] from main::@6 return to:@return -@1: scope:[] from @begin - (byte*) char_cursor#28 ← ((byte*)) (word/signed word) 1024 - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#25 main::@2/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#16 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' - if((boolean~) print_str::$0) goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) char_cursor#27 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#15 main::@5/(byte*) char_cursor#17 ) - (byte*) line_cursor#19 ← phi( main::@1/(byte*) line_cursor#16 main::@3/(byte*) line_cursor#0 main::@5/(byte*) line_cursor#1 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) char_cursor#22 ← phi( print_ln/(byte*) char_cursor#27 ) - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) char_cursor#10 < (byte*) char_cursor#22 - if((boolean~) print_ln::$1) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 - (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#10 ) - (byte*) char_cursor#12 ← phi( @3/(byte*) char_cursor#18 ) + (byte*) line_cursor#15 ← phi( @3/(byte*) line_cursor#13 ) + (byte*) char_cursor#12 ← phi( @3/(byte*) char_cursor#10 ) to:@end @end: scope:[] from @4 +Redundant Phi (byte*) char_cursor#15 (byte*) char_cursor#26 Redundant Phi (byte[]) msg#1 (byte[]) msg#0 -Redundant Phi (byte*) char_cursor#25 (byte*) char_cursor#28 -Redundant Phi (byte*) line_cursor#16 (byte*) char_cursor#28 +Redundant Phi (byte*) char_cursor#27 (byte*) char_cursor#0 +Redundant Phi (byte*) line_cursor#17 (byte*) char_cursor#0 Redundant Phi (byte[]) msg2#1 (byte[]) msg2#0 Redundant Phi (byte[]) msg3#1 (byte[]) msg3#0 -Redundant Phi (byte*) char_cursor#0 (byte*) char_cursor#20 -Redundant Phi (byte*) line_cursor#0 (byte*) char_cursor#10 -Redundant Phi (byte*) char_cursor#1 (byte*) char_cursor#10 -Redundant Phi (byte*) char_cursor#15 (byte*) char_cursor#20 -Redundant Phi (byte*) line_cursor#1 (byte*) char_cursor#10 -Redundant Phi (byte*) char_cursor#16 (byte*) char_cursor#10 -Redundant Phi (byte*) char_cursor#17 (byte*) char_cursor#20 -Redundant Phi (byte*) line_cursor#10 (byte*) char_cursor#10 -Redundant Phi (byte*) char_cursor#18 (byte*) char_cursor#10 -Redundant Phi (byte*) char_cursor#22 (byte*) char_cursor#27 -Redundant Phi (byte*) char_cursor#12 (byte*) char_cursor#18 -Redundant Phi (byte*) line_cursor#15 (byte*) line_cursor#10 +Redundant Phi (byte*) char_cursor#17 (byte*) char_cursor#13 +Redundant Phi (byte*) line_cursor#11 (byte*) char_cursor#16 +Redundant Phi (byte*) char_cursor#18 (byte*) char_cursor#16 +Redundant Phi (byte*) char_cursor#19 (byte*) char_cursor#13 +Redundant Phi (byte*) line_cursor#12 (byte*) char_cursor#16 +Redundant Phi (byte*) char_cursor#20 (byte*) char_cursor#16 +Redundant Phi (byte*) char_cursor#21 (byte*) char_cursor#13 +Redundant Phi (byte*) line_cursor#13 (byte*) char_cursor#16 +Redundant Phi (byte*) char_cursor#10 (byte*) char_cursor#16 +Redundant Phi (byte*) char_cursor#12 (byte*) char_cursor#10 +Redundant Phi (byte*) line_cursor#15 (byte*) line_cursor#13 Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#0 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) char_cursor#26 ← phi( main::@1/(byte*) char_cursor#13 main::@3/(byte*) char_cursor#13 main::@5/(byte*) char_cursor#13 ) + (byte*) line_cursor#16 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#16 < (byte*) char_cursor#26 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 - (byte*) print_str::str#0 ← (byte[]) msg#0 + (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) print_str::str#1 ← (byte[]) msg2#0 + (byte*) print_str::str#2 ← (byte[]) msg2#0 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) print_str::str#2 ← (byte[]) msg3#0 + (byte*) print_str::str#3 ← (byte[]) msg3#0 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 @@ -1147,74 +1185,73 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@1: scope:[] from @begin - (byte*) char_cursor#28 ← ((byte*)) (word/signed word) 1024 - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#28 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' - if((boolean~) print_str::$0) goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) char_cursor#27 ← phi( main::@1/(byte*) char_cursor#20 main::@3/(byte*) char_cursor#20 main::@5/(byte*) char_cursor#20 ) - (byte*) line_cursor#19 ← phi( main::@1/(byte*) char_cursor#28 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) char_cursor#10 < (byte*) char_cursor#27 - if((boolean~) print_ln::$1) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 to:@end @end: scope:[] from @4 -Redundant Phi (byte*) char_cursor#27 (byte*) char_cursor#20 +Redundant Phi (byte*) char_cursor#26 (byte*) char_cursor#13 Succesful SSA optimization Pass2RedundantPhiElimination CONTROL FLOW GRAPH @begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#0 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) line_cursor#16 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#16 < (byte*) char_cursor#13 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 - (byte*) print_str::str#0 ← (byte[]) msg#0 + (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) print_str::str#1 ← (byte[]) msg2#0 + (byte*) print_str::str#2 ← (byte[]) msg2#0 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) print_str::str#2 ← (byte[]) msg3#0 + (byte*) print_str::str#3 ← (byte[]) msg3#0 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 @@ -1225,43 +1262,7 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@1: scope:[] from @begin - (byte*) char_cursor#28 ← ((byte*)) (word/signed word) 1024 - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#28 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - (boolean~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@' - if((boolean~) print_str::$0) goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/(byte*) char_cursor#28 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - (boolean~) print_ln::$1 ← (byte*) char_cursor#10 < (byte*) char_cursor#20 - if((boolean~) print_ln::$1) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 @@ -1269,30 +1270,64 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 @end: scope:[] from @4 Simple Condition (boolean~) print_str::$0 if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 -Simple Condition (boolean~) print_ln::$1 if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@1 +Simple Condition (boolean~) print_ln::$1 if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@1 Succesful SSA optimization Pass2ConditionalJumpSimplification CONTROL FLOW GRAPH @begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#0 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) line_cursor#16 ← phi( main::@1/(byte*) char_cursor#0 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @begin (byte[]) msg#0 ← (string) "hello world! @" (byte[]) msg2#0 ← (string) "hello c64! @" (byte[]) msg3#0 ← (string) "hello 2017! @" - to:@1 + to:@3 main: scope:[main] from @3 - (byte*) print_str::str#0 ← (byte[]) msg#0 + (byte*) print_str::str#1 ← (byte[]) msg#0 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) print_str::str#1 ← (byte[]) msg2#0 + (byte*) print_str::str#2 ← (byte[]) msg2#0 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) print_str::str#2 ← (byte[]) msg3#0 + (byte*) print_str::str#3 ← (byte[]) msg3#0 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 @@ -1303,71 +1338,70 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@1: scope:[] from @begin - (byte*) char_cursor#28 ← ((byte*)) (word/signed word) 1024 - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(byte*) char_cursor#28 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/(byte*) char_cursor#28 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 to:@end @end: scope:[] from @4 +Constant (const byte*) char_cursor#0 = ((byte*))1024 Constant (const byte[]) msg#0 = "hello world! @" Constant (const byte[]) msg2#0 = "hello c64! @" Constant (const byte[]) msg3#0 = "hello 2017! @" -Constant (const byte*) char_cursor#28 = ((byte*))1024 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@1 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#0 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) line_cursor#16 ← phi( main::@1/(const byte*) char_cursor#0 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @begin + to:@3 main: scope:[main] from @3 - (byte*) print_str::str#0 ← (const byte[]) msg#0 + (byte*) print_str::str#1 ← (const byte[]) msg#0 call print_str param-assignment to:main::@1 main::@1: scope:[main] from main call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) print_str::str#1 ← (const byte[]) msg2#0 + (byte*) print_str::str#2 ← (const byte[]) msg2#0 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) print_str::str#2 ← (const byte[]) msg3#0 + (byte*) print_str::str#3 ← (const byte[]) msg3#0 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 @@ -1378,53 +1412,53 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@1: scope:[] from @begin - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#28 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#0 main::@2/(byte*) print_str::str#1 main::@4/(byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/(const byte*) char_cursor#28 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 to:@end @end: scope:[] from @4 -Constant (const byte*) print_str::str#0 = msg#0 -Constant (const byte*) print_str::str#1 = msg2#0 -Constant (const byte*) print_str::str#2 = msg3#0 +Constant (const byte*) print_str::str#1 = msg#0 +Constant (const byte*) print_str::str#2 = msg2#0 +Constant (const byte*) print_str::str#3 = msg3#0 Succesful SSA optimization Pass2ConstantIdentification CONTROL FLOW GRAPH @begin: scope:[] from - to:@1 + to:@2 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#0 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(const byte*) print_str::str#1 main::@2/(const byte*) print_str::str#2 main::@4/(const byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) line_cursor#16 ← phi( main::@1/(const byte*) char_cursor#0 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @begin + to:@3 main: scope:[main] from @3 call print_str param-assignment to:main::@1 @@ -1448,54 +1482,50 @@ main::@6: scope:[main] from main::@5 main::@return: scope:[main] from main::@6 return to:@return -@1: scope:[] from @begin - to:@3 -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#28 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(const byte*) print_str::str#0 main::@2/(const byte*) print_str::str#1 main::@4/(const byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/(const byte*) char_cursor#28 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@1 - to:print_ln::@2 -print_ln::@2: scope:[print_ln] from print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@2 - return - to:@return -@3: scope:[] from @1 +@3: scope:[] from @2 call main param-assignment to:@4 @4: scope:[] from @3 to:@end @end: scope:[] from @4 -Culled Empty Block (label) main::@6 -Culled Empty Block (label) @1 Culled Empty Block (label) print_ln::@2 +Culled Empty Block (label) @2 +Culled Empty Block (label) main::@6 Culled Empty Block (label) @4 Succesful SSA optimization Pass2CullEmptyBlocks CONTROL FLOW GRAPH @begin: scope:[] from to:@3 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#0 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(const byte*) print_str::str#1 main::@2/(const byte*) print_str::str#2 main::@4/(const byte*) print_str::str#3 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) line_cursor#16 ← phi( main::@1/(const byte*) char_cursor#0 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + return + to:@return main: scope:[main] from @3 call print_str param-assignment to:main::@1 @@ -1517,63 +1547,63 @@ main::@5: scope:[main] from main::@4 main::@return: scope:[main] from main::@5 return to:@return -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/(const byte*) char_cursor#28 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(const byte*) print_str::str#0 main::@2/(const byte*) print_str::str#1 main::@4/(const byte*) print_str::str#2 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/(const byte*) char_cursor#28 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@1 - return - to:@return @3: scope:[] from @begin call main param-assignment to:@end @end: scope:[] from @3 -Not aliassing across scopes: char_cursor#10 print_ln::$0 -Not aliassing across scopes: char_cursor#10 print_ln::$0 -Inlining constant with var siblings (const byte*) print_str::str#0 -Inlining constant with var siblings (const byte*) print_str::str#0 -Inlining constant with var siblings (const byte*) print_str::str#0 +Not aliassing across scopes: char_cursor#16 print_ln::$0 +Not aliassing across scopes: char_cursor#16 print_ln::$0 Inlining constant with var siblings (const byte*) print_str::str#1 Inlining constant with var siblings (const byte*) print_str::str#1 Inlining constant with var siblings (const byte*) print_str::str#1 Inlining constant with var siblings (const byte*) print_str::str#2 Inlining constant with var siblings (const byte*) print_str::str#2 Inlining constant with var siblings (const byte*) print_str::str#2 -Inlining constant with var siblings (const byte*) char_cursor#28 -Inlining constant with var siblings (const byte*) char_cursor#28 -Inlining constant with var siblings (const byte*) char_cursor#28 -Inlining constant with var siblings (const byte*) char_cursor#28 -Constant inlined print_str::str#2 = (const byte[]) msg3#0 -Constant inlined print_str::str#1 = (const byte[]) msg2#0 -Constant inlined print_str::str#0 = (const byte[]) msg#0 -Constant inlined char_cursor#28 = ((byte*))(word/signed word) 1024 +Inlining constant with var siblings (const byte*) print_str::str#3 +Inlining constant with var siblings (const byte*) print_str::str#3 +Inlining constant with var siblings (const byte*) print_str::str#3 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Constant inlined print_str::str#3 = (const byte[]) msg3#0 +Constant inlined print_str::str#2 = (const byte[]) msg2#0 +Constant inlined char_cursor#0 = ((byte*))(word/signed word) 1024 +Constant inlined print_str::str#1 = (const byte[]) msg#0 Succesful SSA optimization Pass2ConstantInlining CONTROL FLOW GRAPH @begin: scope:[] from to:@3 +print_str: scope:[print_str] from main main::@2 main::@4 + (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*) char_cursor#16 main::@4/(byte*) char_cursor#16 ) + (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) + (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) + if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 + to:print_str::@return +print_str::@2: scope:[print_str] from print_str::@1 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + to:print_str::@1 +print_str::@return: scope:[print_str] from print_str::@1 + return + to:@return +print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 + (byte*) line_cursor#16 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*) char_cursor#16 main::@5/(byte*) char_cursor#16 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + return + to:@return main: scope:[main] from @3 call print_str param-assignment to:main::@1 @@ -1595,35 +1625,6 @@ main::@5: scope:[main] from main::@4 main::@return: scope:[main] from main::@5 return to:@return -print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*) char_cursor#10 main::@4/(byte*) char_cursor#10 ) - (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) - to:print_str::@1 -print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) - (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) - if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 - to:print_str::@return -print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - to:print_str::@1 -print_str::@return: scope:[print_str] from print_str::@1 - return - to:@return -print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*) char_cursor#10 main::@5/(byte*) char_cursor#10 ) - to:print_ln::@1 -print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*) char_cursor#10 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@1 - to:print_ln::@return -print_ln::@return: scope:[print_ln] from print_ln::@1 - return - to:@return @3: scope:[] from @begin call main param-assignment to:@end @@ -1634,13 +1635,13 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (byte*) char_cursor -(byte*) char_cursor#10 -(byte*) char_cursor#20 +(byte*) char_cursor#1 +(byte*) char_cursor#13 +(byte*) char_cursor#16 (byte*) char_cursor#29 -(byte*) char_cursor#8 (byte*) line_cursor -(byte*) line_cursor#12 -(byte*) line_cursor#19 +(byte*) line_cursor#16 +(byte*) line_cursor#8 (void()) main() (label) main::@1 (label) main::@2 @@ -1663,7 +1664,7 @@ FINAL SYMBOL TABLE (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#3 +(byte*) print_str::str#0 (byte*) print_str::str#4 (byte*) print_str::str#6 @@ -1684,48 +1685,48 @@ main::@1: scope:[main] from main call print_ln param-assignment to:main::@2 main::@2: scope:[main] from main::@1 - (byte*~) char_cursor#33 ← (byte*) char_cursor#10 + (byte*~) char_cursor#34 ← (byte*) char_cursor#16 call print_str param-assignment to:main::@3 main::@3: scope:[main] from main::@2 - (byte*~) char_cursor#30 ← (byte*) char_cursor#10 + (byte*~) char_cursor#31 ← (byte*) char_cursor#16 call print_ln param-assignment to:main::@4 main::@4: scope:[main] from main::@3 - (byte*~) char_cursor#34 ← (byte*) char_cursor#10 + (byte*~) char_cursor#35 ← (byte*) char_cursor#16 call print_str param-assignment to:main::@5 main::@5: scope:[main] from main::@4 - (byte*~) char_cursor#31 ← (byte*) char_cursor#10 + (byte*~) char_cursor#32 ← (byte*) char_cursor#16 call print_ln param-assignment to:main::@return main::@return: scope:[main] from main::@5 return to:@return print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - (byte*) line_cursor#19 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) char_cursor#30 main::@5/(byte*~) char_cursor#31 ) - (byte*~) line_cursor#22 ← (byte*) line_cursor#19 + (byte*) line_cursor#16 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) char_cursor#31 main::@5/(byte*~) char_cursor#32 ) + (byte*~) line_cursor#23 ← (byte*) line_cursor#16 to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@3 - (byte*) line_cursor#12 ← phi( print_ln/(byte*~) line_cursor#22 print_ln::@3/(byte*~) char_cursor#32 ) - (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 - (byte*) char_cursor#10 ← (byte*~) print_ln::$0 - if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@3 + (byte*) line_cursor#8 ← phi( print_ln/(byte*~) line_cursor#23 print_ln::@3/(byte*~) char_cursor#33 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@3 to:print_ln::@return print_ln::@return: scope:[print_ln] from print_ln::@1 return to:@return print_ln::@3: scope:[print_ln] from print_ln::@1 - (byte*~) char_cursor#32 ← (byte*) char_cursor#10 + (byte*~) char_cursor#33 ← (byte*) char_cursor#16 to:print_ln::@1 print_str: scope:[print_str] from main main::@2 main::@4 - (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#33 main::@4/(byte*~) char_cursor#34 ) + (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#34 main::@4/(byte*~) char_cursor#35 ) (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) (byte*~) print_str::str#7 ← (byte*) print_str::str#6 - (byte*~) char_cursor#35 ← (byte*) char_cursor#29 + (byte*~) char_cursor#36 ← (byte*) char_cursor#29 to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 - (byte*) char_cursor#20 ← phi( print_str/(byte*~) char_cursor#35 print_str::@2/(byte*~) char_cursor#36 ) + (byte*) char_cursor#13 ← phi( print_str/(byte*~) char_cursor#36 print_str::@2/(byte*~) char_cursor#37 ) (byte*) print_str::str#4 ← phi( print_str/(byte*~) print_str::str#7 print_str::@2/(byte*~) print_str::str#8 ) if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 to:print_str::@return @@ -1733,11 +1734,11 @@ print_str::@return: scope:[print_str] from print_str::@1 return to:@return print_str::@2: scope:[print_str] from print_str::@1 - *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) - (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 - (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 - (byte*~) print_str::str#8 ← (byte*) print_str::str#3 - (byte*~) char_cursor#36 ← (byte*) char_cursor#8 + *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) + (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 + (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 + (byte*~) print_str::str#8 ← (byte*) print_str::str#0 + (byte*~) char_cursor#37 ← (byte*) char_cursor#1 to:print_str::@1 Adding NOP phi() at start of @begin @@ -1770,81 +1771,81 @@ CONTROL FLOW GRAPH - LIVE RANGES FOUND [3] phi() [ ] main: scope:[main] from @3 [4] phi() [ ] - [5] call print_str param-assignment [ char_cursor#20 ] + [5] call print_str param-assignment [ char_cursor#13 ] to:main::@1 main::@1: scope:[main] from main - [6] phi() [ char_cursor#20 ] - [7] call print_ln param-assignment [ char_cursor#10 ] + [6] phi() [ char_cursor#13 ] + [7] call print_ln param-assignment [ char_cursor#16 ] to:main::@2 main::@2: scope:[main] from main::@1 - [8] (byte*~) char_cursor#33 ← (byte*) char_cursor#10 [ char_cursor#33 char_cursor#10 ] - [9] call print_str param-assignment [ char_cursor#10 char_cursor#20 ] + [8] (byte*~) char_cursor#34 ← (byte*) char_cursor#16 [ char_cursor#34 char_cursor#16 ] + [9] call print_str param-assignment [ char_cursor#16 char_cursor#13 ] to:main::@3 main::@3: scope:[main] from main::@2 - [10] (byte*~) char_cursor#30 ← (byte*) char_cursor#10 [ char_cursor#30 char_cursor#20 ] - [11] call print_ln param-assignment [ char_cursor#10 ] + [10] (byte*~) char_cursor#31 ← (byte*) char_cursor#16 [ char_cursor#31 char_cursor#13 ] + [11] call print_ln param-assignment [ char_cursor#16 ] to:main::@4 main::@4: scope:[main] from main::@3 - [12] (byte*~) char_cursor#34 ← (byte*) char_cursor#10 [ char_cursor#10 char_cursor#34 ] - [13] call print_str param-assignment [ char_cursor#10 char_cursor#20 ] + [12] (byte*~) char_cursor#35 ← (byte*) char_cursor#16 [ char_cursor#16 char_cursor#35 ] + [13] call print_str param-assignment [ char_cursor#16 char_cursor#13 ] to:main::@5 main::@5: scope:[main] from main::@4 - [14] (byte*~) char_cursor#31 ← (byte*) char_cursor#10 [ char_cursor#31 char_cursor#20 ] + [14] (byte*~) char_cursor#32 ← (byte*) char_cursor#16 [ char_cursor#32 char_cursor#13 ] [15] call print_ln param-assignment [ ] to:main::@return main::@return: scope:[main] from main::@5 [16] return [ ] to:@return print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - [17] (byte*) line_cursor#19 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) char_cursor#30 main::@5/(byte*~) char_cursor#31 ) [ line_cursor#19 char_cursor#20 ] - [18] (byte*~) line_cursor#22 ← (byte*) line_cursor#19 [ line_cursor#22 char_cursor#20 ] + [17] (byte*) line_cursor#16 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) char_cursor#31 main::@5/(byte*~) char_cursor#32 ) [ line_cursor#16 char_cursor#13 ] + [18] (byte*~) line_cursor#23 ← (byte*) line_cursor#16 [ line_cursor#23 char_cursor#13 ] to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@3 - [19] (byte*) line_cursor#12 ← phi( print_ln/(byte*~) line_cursor#22 print_ln::@3/(byte*~) char_cursor#32 ) [ line_cursor#12 char_cursor#20 ] - [20] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] - [21] (byte*) char_cursor#10 ← (byte*~) print_ln::$0 [ char_cursor#10 char_cursor#20 ] - [22] if((byte*) char_cursor#10<(byte*) char_cursor#20) goto print_ln::@3 [ char_cursor#10 char_cursor#20 ] + [19] (byte*) line_cursor#8 ← phi( print_ln/(byte*~) line_cursor#23 print_ln::@3/(byte*~) char_cursor#33 ) [ line_cursor#8 char_cursor#13 ] + [20] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] + [21] (byte*) char_cursor#16 ← (byte*~) print_ln::$0 [ char_cursor#16 char_cursor#13 ] + [22] if((byte*) char_cursor#16<(byte*) char_cursor#13) goto print_ln::@3 [ char_cursor#16 char_cursor#13 ] to:print_ln::@return print_ln::@return: scope:[print_ln] from print_ln::@1 - [23] return [ char_cursor#10 ] + [23] return [ char_cursor#16 ] to:@return print_ln::@3: scope:[print_ln] from print_ln::@1 - [24] (byte*~) char_cursor#32 ← (byte*) char_cursor#10 [ char_cursor#32 char_cursor#20 ] + [24] (byte*~) char_cursor#33 ← (byte*) char_cursor#16 [ char_cursor#33 char_cursor#13 ] to:print_ln::@1 print_str: scope:[print_str] from main main::@2 main::@4 - [25] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#33 main::@4/(byte*~) char_cursor#34 ) [ print_str::str#6 char_cursor#29 ] + [25] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#34 main::@4/(byte*~) char_cursor#35 ) [ print_str::str#6 char_cursor#29 ] [25] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) [ print_str::str#6 char_cursor#29 ] [26] (byte*~) print_str::str#7 ← (byte*) print_str::str#6 [ char_cursor#29 print_str::str#7 ] - [27] (byte*~) char_cursor#35 ← (byte*) char_cursor#29 [ print_str::str#7 char_cursor#35 ] + [27] (byte*~) char_cursor#36 ← (byte*) char_cursor#29 [ print_str::str#7 char_cursor#36 ] to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 - [28] (byte*) char_cursor#20 ← phi( print_str/(byte*~) char_cursor#35 print_str::@2/(byte*~) char_cursor#36 ) [ char_cursor#20 print_str::str#4 ] - [28] (byte*) print_str::str#4 ← phi( print_str/(byte*~) print_str::str#7 print_str::@2/(byte*~) print_str::str#8 ) [ char_cursor#20 print_str::str#4 ] - [29] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] + [28] (byte*) char_cursor#13 ← phi( print_str/(byte*~) char_cursor#36 print_str::@2/(byte*~) char_cursor#37 ) [ char_cursor#13 print_str::str#4 ] + [28] (byte*) print_str::str#4 ← phi( print_str/(byte*~) print_str::str#7 print_str::@2/(byte*~) print_str::str#8 ) [ char_cursor#13 print_str::str#4 ] + [29] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] to:print_str::@return print_str::@return: scope:[print_str] from print_str::@1 - [30] return [ char_cursor#20 ] + [30] return [ char_cursor#13 ] to:@return print_str::@2: scope:[print_str] from print_str::@1 - [31] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] - [32] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] - [33] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ char_cursor#8 print_str::str#3 ] - [34] (byte*~) print_str::str#8 ← (byte*) print_str::str#3 [ print_str::str#8 char_cursor#8 ] - [35] (byte*~) char_cursor#36 ← (byte*) char_cursor#8 [ print_str::str#8 char_cursor#36 ] + [31] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] + [32] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] + [33] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ char_cursor#1 print_str::str#0 ] + [34] (byte*~) print_str::str#8 ← (byte*) print_str::str#0 [ print_str::str#8 char_cursor#1 ] + [35] (byte*~) char_cursor#37 ← (byte*) char_cursor#1 [ print_str::str#8 char_cursor#37 ] to:print_str::@1 Created 6 initial phi equivalence classes -Not coalescing [8] char_cursor#33 ← char_cursor#10 -Coalesced [10] char_cursor#30 ← char_cursor#10 -Not coalescing [12] char_cursor#34 ← char_cursor#10 -Coalesced (already) [14] char_cursor#31 ← char_cursor#10 -Coalesced [18] line_cursor#22 ← line_cursor#19 -Coalesced [21] char_cursor#10 ← print_ln::$0 -Coalesced (already) [24] char_cursor#32 ← char_cursor#10 +Not coalescing [8] char_cursor#34 ← char_cursor#16 +Coalesced [10] char_cursor#31 ← char_cursor#16 +Not coalescing [12] char_cursor#35 ← char_cursor#16 +Coalesced (already) [14] char_cursor#32 ← char_cursor#16 +Coalesced [18] line_cursor#23 ← line_cursor#16 +Coalesced [21] char_cursor#16 ← print_ln::$0 +Coalesced (already) [24] char_cursor#33 ← char_cursor#16 Coalesced [26] print_str::str#7 ← print_str::str#6 -Coalesced [27] char_cursor#35 ← char_cursor#29 -Coalesced [34] print_str::str#8 ← print_str::str#3 -Coalesced [35] char_cursor#36 ← char_cursor#8 +Coalesced [27] char_cursor#36 ← char_cursor#29 +Coalesced [34] print_str::str#8 ← print_str::str#0 +Coalesced [35] char_cursor#37 ← char_cursor#1 Coalesced down to 3 phi equivalence classes Culled Empty Block (label) print_ln::@3 Block Sequence Planned @begin @3 @end main main::@1 main::@2 main::@3 main::@4 main::@5 main::@return print_ln print_ln::@1 print_ln::@return print_str print_str::@1 print_str::@return print_str::@2 @@ -1874,58 +1875,58 @@ CONTROL FLOW GRAPH - BEFORE EFFECTIVE LIVE RANGES [3] phi() [ ] main: scope:[main] from @3 [4] phi() [ ] - [5] call print_str param-assignment [ char_cursor#20 ] + [5] call print_str param-assignment [ char_cursor#13 ] to:main::@1 main::@1: scope:[main] from main - [6] phi() [ char_cursor#20 ] + [6] phi() [ char_cursor#13 ] [7] call print_ln param-assignment [ print_ln::$0 ] to:main::@2 main::@2: scope:[main] from main::@1 - [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] - [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] + [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] + [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] to:main::@3 main::@3: scope:[main] from main::@2 - [10] phi() [ print_ln::$0 char_cursor#20 ] + [10] phi() [ print_ln::$0 char_cursor#13 ] [11] call print_ln param-assignment [ print_ln::$0 ] to:main::@4 main::@4: scope:[main] from main::@3 - [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] - [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] + [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] + [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] to:main::@5 main::@5: scope:[main] from main::@4 - [14] phi() [ print_ln::$0 char_cursor#20 ] + [14] phi() [ print_ln::$0 char_cursor#13 ] [15] call print_ln param-assignment [ ] to:main::@return main::@return: scope:[main] from main::@5 [16] return [ ] to:@return print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - [17] (byte*) line_cursor#19 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) print_ln::$0 main::@5/(byte*~) print_ln::$0 ) [ line_cursor#19 char_cursor#20 ] + [17] (byte*) line_cursor#16 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) print_ln::$0 main::@5/(byte*~) print_ln::$0 ) [ line_cursor#16 char_cursor#13 ] to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - [18] (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#12 char_cursor#20 ] - [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] - [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] + [18] (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#8 char_cursor#13 ] + [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] + [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] to:print_ln::@return print_ln::@return: scope:[print_ln] from print_ln::@1 [21] return [ print_ln::$0 ] to:@return print_str: scope:[print_str] from main main::@2 main::@4 - [22] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#33 main::@4/(byte*~) char_cursor#34 ) [ print_str::str#6 char_cursor#29 ] + [22] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#34 main::@4/(byte*~) char_cursor#35 ) [ print_str::str#6 char_cursor#29 ] [22] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) [ print_str::str#6 char_cursor#29 ] to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 - [23] (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) [ char_cursor#20 print_str::str#4 ] - [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) [ char_cursor#20 print_str::str#4 ] - [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] + [23] (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) [ char_cursor#13 print_str::str#4 ] + [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) [ char_cursor#13 print_str::str#4 ] + [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] to:print_str::@return print_str::@return: scope:[print_str] from print_str::@1 - [25] return [ char_cursor#20 ] + [25] return [ char_cursor#13 ] to:@return print_str::@2: scope:[print_str] from print_str::@1 - [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] - [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] - [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] + [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] + [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] + [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] to:print_str::@1 CONTROL FLOW GRAPH - PHI MEM COALESCED @@ -1940,58 +1941,58 @@ CONTROL FLOW GRAPH - PHI MEM COALESCED [3] phi() [ ] ( ) main: scope:[main] from @3 [4] phi() [ ] ( main:2 [ ] ) - [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) to:main::@1 main::@1: scope:[main] from main - [6] phi() [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + [6] phi() [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) to:main::@2 main::@2: scope:[main] from main::@1 - [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) - [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) + [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) to:main::@3 main::@3: scope:[main] from main::@2 - [10] phi() [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + [10] phi() [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) [11] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) to:main::@4 main::@4: scope:[main] from main::@3 - [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) - [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) + [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) to:main::@5 main::@5: scope:[main] from main::@4 - [14] phi() [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + [14] phi() [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) [15] call print_ln param-assignment [ ] ( main:2 [ ] ) to:main::@return main::@return: scope:[main] from main::@5 [16] return [ ] ( main:2 [ ] ) to:@return print_ln: scope:[print_ln] from main::@1 main::@3 main::@5 - [17] (byte*) line_cursor#19 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) print_ln::$0 main::@5/(byte*~) print_ln::$0 ) [ line_cursor#19 char_cursor#20 ] ( main:2::print_ln:7 [ line_cursor#19 char_cursor#20 ] main:2::print_ln:11 [ line_cursor#19 char_cursor#20 ] main:2::print_ln:15 [ line_cursor#19 char_cursor#20 ] ) + [17] (byte*) line_cursor#16 ← phi( main::@1/((byte*))(word/signed word) 1024 main::@3/(byte*~) print_ln::$0 main::@5/(byte*~) print_ln::$0 ) [ line_cursor#16 char_cursor#13 ] ( main:2::print_ln:7 [ line_cursor#16 char_cursor#13 ] main:2::print_ln:11 [ line_cursor#16 char_cursor#13 ] main:2::print_ln:15 [ line_cursor#16 char_cursor#13 ] ) to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 - [18] (byte*) line_cursor#12 ← phi( print_ln/(byte*) line_cursor#19 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#12 char_cursor#20 ] ( main:2::print_ln:7 [ line_cursor#12 char_cursor#20 ] main:2::print_ln:11 [ line_cursor#12 char_cursor#20 ] main:2::print_ln:15 [ line_cursor#12 char_cursor#20 ] ) - [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) - [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) + [18] (byte*) line_cursor#8 ← phi( print_ln/(byte*) line_cursor#16 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#8 char_cursor#13 ] ( main:2::print_ln:7 [ line_cursor#8 char_cursor#13 ] main:2::print_ln:11 [ line_cursor#8 char_cursor#13 ] main:2::print_ln:15 [ line_cursor#8 char_cursor#13 ] ) + [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) + [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) to:print_ln::@return print_ln::@return: scope:[print_ln] from print_ln::@1 [21] return [ print_ln::$0 ] ( main:2::print_ln:7 [ print_ln::$0 ] main:2::print_ln:11 [ print_ln::$0 ] main:2::print_ln:15 [ print_ln::$0 ] ) to:@return print_str: scope:[print_str] from main main::@2 main::@4 - [22] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#33 main::@4/(byte*~) char_cursor#34 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) + [22] (byte*) char_cursor#29 ← phi( main/((byte*))(word/signed word) 1024 main::@2/(byte*~) char_cursor#34 main::@4/(byte*~) char_cursor#35 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) [22] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 ) [ print_str::str#6 char_cursor#29 ] ( main:2::print_str:5 [ print_str::str#6 char_cursor#29 ] main:2::print_str:9 [ print_ln::$0 print_str::str#6 char_cursor#29 ] main:2::print_str:13 [ print_ln::$0 print_str::str#6 char_cursor#29 ] ) to:print_str::@1 print_str::@1: scope:[print_str] from print_str print_str::@2 - [23] (byte*) char_cursor#20 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#8 ) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#3 ) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) + [23] (byte*) char_cursor#13 ← phi( print_str/(byte*) char_cursor#29 print_str::@2/(byte*) char_cursor#1 ) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + [23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 ) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) to:print_str::@return print_str::@return: scope:[print_str] from print_str::@1 - [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) to:@return print_str::@2: scope:[print_str] from print_str::@1 - [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) - [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) - [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) + [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) + [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) + [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) to:print_str::@1 DOMINATORS @@ -2034,14 +2035,14 @@ Loop head: print_str::@1 tails: print_str::@2 blocks: print_str::@2 print_str::@ VARIABLE REGISTER WEIGHTS (byte*) char_cursor -(byte*) char_cursor#20 3.2857142857142856 +(byte*) char_cursor#1 11.0 +(byte*) char_cursor#13 3.2857142857142856 (byte*) char_cursor#29 6.0 -(byte*~) char_cursor#33 4.0 (byte*~) char_cursor#34 4.0 -(byte*) char_cursor#8 11.0 +(byte*~) char_cursor#35 4.0 (byte*) line_cursor -(byte*) line_cursor#12 24.0 -(byte*) line_cursor#19 6.0 +(byte*) line_cursor#16 6.0 +(byte*) line_cursor#8 24.0 (void()) main() (byte[]) msg (byte[]) msg2 @@ -2050,21 +2051,32 @@ VARIABLE REGISTER WEIGHTS (byte*~) print_ln::$0 3.7272727272727275 (void()) print_str((byte*) print_str::str) (byte*) print_str::str -(byte*) print_str::str#3 22.0 +(byte*) print_str::str#0 22.0 (byte*) print_str::str#4 11.5 (byte*) print_str::str#6 2.0 Initial phi equivalence classes -[ line_cursor#12 line_cursor#19 print_ln::$0 ] -[ print_str::str#4 print_str::str#6 print_str::str#3 ] -[ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] +[ line_cursor#8 line_cursor#16 print_ln::$0 ] +[ print_str::str#4 print_str::str#6 print_str::str#0 ] +[ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] Complete equivalence classes -[ line_cursor#12 line_cursor#19 print_ln::$0 ] -[ print_str::str#4 print_str::str#6 print_str::str#3 ] -[ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] -Allocated zp ZP_PTR_BYTE:2 [ line_cursor#12 line_cursor#19 print_ln::$0 ] -Allocated zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#3 ] -Allocated zp ZP_PTR_BYTE:6 [ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] +[ line_cursor#8 line_cursor#16 print_ln::$0 ] +[ print_str::str#4 print_str::str#6 print_str::str#0 ] +[ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] +Allocated zp ZP_PTR_BYTE:2 [ line_cursor#8 line_cursor#16 print_ln::$0 ] +Allocated zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] +Allocated zp ZP_PTR_BYTE:6 [ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] +Succesfully loaded fragment zpptrby1=cowo1 +Succesfully loaded fragment zpptrby1=zpptrby2 +Succesfully loaded fragment zpptrby1=zpptrby1_plus_coby1 +Succesfully loaded fragment zpptrby1_lt_zpptrby2_then_la1 +Attempting fragment synthesis _deref_zpptrby1_neq_coby1_then_la1 +Succesfully loaded fragment aby_neq_coby1_then_la1 +Succesfully synthesized fragment _deref_zpptrby1_neq_coby1_then_la1 (from aby_neq_coby1_then_la1) +Attempting fragment synthesis _deref_zpptrby1=_deref_zpptrby2 +Succesfully loaded fragment aby=_deref_zpptrby1 +Succesfully synthesized fragment _deref_zpptrby1=_deref_zpptrby2 (from aby=_deref_zpptrby1) +Succesfully loaded fragment zpptrby1=_inc_zpptrby1 INITIAL ASM //SEG0 Basic Upstart .pc = $801 "Basic" @@ -2094,7 +2106,7 @@ bend_from_b3: bend: //SEG9 main main: { - //SEG10 [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + //SEG10 [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) //SEG11 [22] phi from main to print_str [phi:main->print_str] print_str_from_main: //SEG12 [22] phi (byte*) char_cursor#29 = ((byte*))(word/signed word) 1024 [phi:main->print_str#0] -- zpptrby1=cowo1 @@ -2116,7 +2128,7 @@ main: { //SEG16 [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) //SEG17 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln] print_ln_from_b1: - //SEG18 [17] phi (byte*) line_cursor#19 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 + //SEG18 [17] phi (byte*) line_cursor#16 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 lda #<$400 sta line_cursor lda #>$400 @@ -2125,15 +2137,15 @@ main: { jmp b2 //SEG19 main::@2 b2: - //SEG20 [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + //SEG20 [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG22 [22] phi from main::@2 to print_str [phi:main::@2->print_str] print_str_from_b2: - //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#33 [phi:main::@2->print_str#0] -- register_copy + //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@2->print_str#0] -- register_copy //SEG24 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- zpptrby1=cowo1 lda #print_ln] print_ln_from_b3: - //SEG29 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy + //SEG29 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy jsr print_ln jmp b4 //SEG30 main::@4 b4: - //SEG31 [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) -- zpptrby1=zpptrby2 + //SEG31 [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG33 [22] phi from main::@4 to print_str [phi:main::@4->print_str] print_str_from_b4: - //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@4->print_str#0] -- register_copy + //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#35 [phi:main::@4->print_str#0] -- register_copy //SEG35 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- zpptrby1=cowo1 lda #print_ln] print_ln_from_b5: - //SEG40 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy + //SEG40 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy jsr print_ln jmp breturn //SEG41 main::@return @@ -2190,11 +2202,11 @@ print_ln: { //SEG44 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] b1_from_print_ln: b1_from_b1: - //SEG45 [18] phi (byte*) line_cursor#12 = (byte*) line_cursor#19 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG45 [18] phi (byte*) line_cursor#8 = (byte*) line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy jmp b1 //SEG46 print_ln::@1 b1: - //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1=zpptrby1_plus_coby1 + //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1=zpptrby1_plus_coby1 lda _0 clc adc #$28 @@ -2202,7 +2214,7 @@ print_ln: { bcc !+ inc _0+1 !: - //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1_lt_zpptrby2_then_la1 lda _0+1 cmp char_cursor+1 bcc b1_from_b1 @@ -2223,12 +2235,12 @@ print_str: { //SEG52 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] b1_from_print_str: b1_from_b2: - //SEG53 [23] phi (byte*) char_cursor#20 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy + //SEG53 [23] phi (byte*) char_cursor#13 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy //SEG54 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy jmp b1 //SEG55 print_str::@1 b1: - //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 + //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 ldy #0 lda (str),y cmp #'@' @@ -2236,21 +2248,21 @@ print_str: { jmp breturn //SEG57 print_str::@return breturn: - //SEG58 [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + //SEG58 [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) rts //SEG59 print_str::@2 b2: - //SEG60 [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 + //SEG60 [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 ldy #0 lda (str),y ldy #0 sta (char_cursor),y - //SEG61 [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG61 [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc char_cursor bne !+ inc char_cursor+1 !: - //SEG62 [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG62 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc str bne !+ inc str+1 @@ -2259,26 +2271,26 @@ print_str: { } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) always clobbers reg byte a -Statement [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) always clobbers reg byte a -Statement [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) always clobbers reg byte a -Statement [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) always clobbers reg byte a -Statement [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) always clobbers reg byte a reg byte y -Statement [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) always clobbers reg byte a reg byte y -Potential registers zp ZP_PTR_BYTE:2 [ line_cursor#12 line_cursor#19 print_ln::$0 ] : zp ZP_PTR_BYTE:2 , -Potential registers zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#3 ] : zp ZP_PTR_BYTE:4 , -Potential registers zp ZP_PTR_BYTE:6 [ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] : zp ZP_PTR_BYTE:6 , +Statement [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) always clobbers reg byte a +Statement [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) always clobbers reg byte a +Statement [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) always clobbers reg byte a +Statement [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) always clobbers reg byte a +Statement [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) always clobbers reg byte a reg byte y +Statement [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) always clobbers reg byte a reg byte y +Potential registers zp ZP_PTR_BYTE:2 [ line_cursor#8 line_cursor#16 print_ln::$0 ] : zp ZP_PTR_BYTE:2 , +Potential registers zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] : zp ZP_PTR_BYTE:4 , +Potential registers zp ZP_PTR_BYTE:6 [ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] : zp ZP_PTR_BYTE:6 , REGISTER UPLIFT SCOPES -Uplift Scope [] 33.73: zp ZP_PTR_BYTE:2 [ line_cursor#12 line_cursor#19 print_ln::$0 ] 28.29: zp ZP_PTR_BYTE:6 [ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] -Uplift Scope [print_str] 35.5: zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#3 ] -Uplift Scope [main] +Uplift Scope [] 33.73: zp ZP_PTR_BYTE:2 [ line_cursor#8 line_cursor#16 print_ln::$0 ] 28.29: zp ZP_PTR_BYTE:6 [ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] +Uplift Scope [print_str] 35.5: zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] Uplift Scope [print_ln] +Uplift Scope [main] -Uplifting [] best 1262 combination zp ZP_PTR_BYTE:2 [ line_cursor#12 line_cursor#19 print_ln::$0 ] zp ZP_PTR_BYTE:6 [ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] -Uplifting [print_str] best 1262 combination zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#3 ] -Uplifting [main] best 1262 combination +Uplifting [] best 1262 combination zp ZP_PTR_BYTE:2 [ line_cursor#8 line_cursor#16 print_ln::$0 ] zp ZP_PTR_BYTE:6 [ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] +Uplifting [print_str] best 1262 combination zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] Uplifting [print_ln] best 1262 combination +Uplifting [main] best 1262 combination Removing instruction jmp b3 Removing instruction jmp bend Removing instruction jmp b1 @@ -2319,7 +2331,7 @@ bend_from_b3: bend: //SEG9 main main: { - //SEG10 [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + //SEG10 [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) //SEG11 [22] phi from main to print_str [phi:main->print_str] print_str_from_main: //SEG12 [22] phi (byte*) char_cursor#29 = ((byte*))(word/signed word) 1024 [phi:main->print_str#0] -- zpptrby1=cowo1 @@ -2340,7 +2352,7 @@ main: { //SEG16 [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) //SEG17 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln] print_ln_from_b1: - //SEG18 [17] phi (byte*) line_cursor#19 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 + //SEG18 [17] phi (byte*) line_cursor#16 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 lda #<$400 sta line_cursor lda #>$400 @@ -2348,15 +2360,15 @@ main: { jsr print_ln //SEG19 main::@2 b2: - //SEG20 [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + //SEG20 [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG22 [22] phi from main::@2 to print_str [phi:main::@2->print_str] print_str_from_b2: - //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#33 [phi:main::@2->print_str#0] -- register_copy + //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@2->print_str#0] -- register_copy //SEG24 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- zpptrby1=cowo1 lda #print_ln] print_ln_from_b3: - //SEG29 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy + //SEG29 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy jsr print_ln //SEG30 main::@4 b4: - //SEG31 [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) -- zpptrby1=zpptrby2 + //SEG31 [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG33 [22] phi from main::@4 to print_str [phi:main::@4->print_str] print_str_from_b4: - //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@4->print_str#0] -- register_copy + //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#35 [phi:main::@4->print_str#0] -- register_copy //SEG35 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- zpptrby1=cowo1 lda #print_ln] print_ln_from_b5: - //SEG40 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy + //SEG40 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy jsr print_ln //SEG41 main::@return breturn: @@ -2409,10 +2421,10 @@ print_ln: { //SEG44 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] b1_from_print_ln: b1_from_b1: - //SEG45 [18] phi (byte*) line_cursor#12 = (byte*) line_cursor#19 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG45 [18] phi (byte*) line_cursor#8 = (byte*) line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy //SEG46 print_ln::@1 b1: - //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1=zpptrby1_plus_coby1 + //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1=zpptrby1_plus_coby1 lda _0 clc adc #$28 @@ -2420,7 +2432,7 @@ print_ln: { bcc !+ inc _0+1 !: - //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1_lt_zpptrby2_then_la1 lda _0+1 cmp char_cursor+1 bcc b1_from_b1 @@ -2440,32 +2452,32 @@ print_str: { //SEG52 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] b1_from_print_str: b1_from_b2: - //SEG53 [23] phi (byte*) char_cursor#20 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy + //SEG53 [23] phi (byte*) char_cursor#13 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy //SEG54 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy //SEG55 print_str::@1 b1: - //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 + //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 ldy #0 lda (str),y cmp #'@' bne b2 //SEG57 print_str::@return breturn: - //SEG58 [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + //SEG58 [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) rts //SEG59 print_str::@2 b2: - //SEG60 [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 + //SEG60 [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 ldy #0 lda (str),y ldy #0 sta (char_cursor),y - //SEG61 [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG61 [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc char_cursor bne !+ inc char_cursor+1 !: - //SEG62 [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG62 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc str bne !+ inc str+1 @@ -2502,7 +2514,7 @@ bend_from_b3: bend: //SEG9 main main: { - //SEG10 [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + //SEG10 [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) //SEG11 [22] phi from main to print_str [phi:main->print_str] print_str_from_main: //SEG12 [22] phi (byte*) char_cursor#29 = ((byte*))(word/signed word) 1024 [phi:main->print_str#0] -- zpptrby1=cowo1 @@ -2523,7 +2535,7 @@ main: { //SEG16 [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) //SEG17 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln] print_ln_from_b1: - //SEG18 [17] phi (byte*) line_cursor#19 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 + //SEG18 [17] phi (byte*) line_cursor#16 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 lda #<$400 sta line_cursor lda #>$400 @@ -2531,15 +2543,15 @@ main: { jsr print_ln //SEG19 main::@2 b2: - //SEG20 [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + //SEG20 [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG22 [22] phi from main::@2 to print_str [phi:main::@2->print_str] print_str_from_b2: - //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#33 [phi:main::@2->print_str#0] -- register_copy + //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@2->print_str#0] -- register_copy //SEG24 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- zpptrby1=cowo1 lda #print_ln] print_ln_from_b3: - //SEG29 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy + //SEG29 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy jsr print_ln //SEG30 main::@4 b4: - //SEG31 [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) -- zpptrby1=zpptrby2 + //SEG31 [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG33 [22] phi from main::@4 to print_str [phi:main::@4->print_str] print_str_from_b4: - //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@4->print_str#0] -- register_copy + //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#35 [phi:main::@4->print_str#0] -- register_copy //SEG35 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- zpptrby1=cowo1 lda #print_ln] print_ln_from_b5: - //SEG40 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy + //SEG40 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy jsr print_ln //SEG41 main::@return breturn: @@ -2592,10 +2604,10 @@ print_ln: { //SEG44 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] b1_from_print_ln: b1_from_b1: - //SEG45 [18] phi (byte*) line_cursor#12 = (byte*) line_cursor#19 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG45 [18] phi (byte*) line_cursor#8 = (byte*) line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy //SEG46 print_ln::@1 b1: - //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1=zpptrby1_plus_coby1 + //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1=zpptrby1_plus_coby1 lda _0 clc adc #$28 @@ -2603,7 +2615,7 @@ print_ln: { bcc !+ inc _0+1 !: - //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1_lt_zpptrby2_then_la1 lda _0+1 cmp char_cursor+1 bcc b1_from_b1 @@ -2623,31 +2635,31 @@ print_str: { //SEG52 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] b1_from_print_str: b1_from_b2: - //SEG53 [23] phi (byte*) char_cursor#20 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy + //SEG53 [23] phi (byte*) char_cursor#13 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy //SEG54 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy //SEG55 print_str::@1 b1: - //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 + //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 ldy #0 lda (str),y cmp #'@' bne b2 //SEG57 print_str::@return breturn: - //SEG58 [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + //SEG58 [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) rts //SEG59 print_str::@2 b2: - //SEG60 [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 + //SEG60 [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 ldy #0 lda (str),y sta (char_cursor),y - //SEG61 [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG61 [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc char_cursor bne !+ inc char_cursor+1 !: - //SEG62 [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG62 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc str bne !+ inc str+1 @@ -2696,7 +2708,7 @@ b3: bend: //SEG9 main main: { - //SEG10 [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + //SEG10 [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) //SEG11 [22] phi from main to print_str [phi:main->print_str] print_str_from_main: //SEG12 [22] phi (byte*) char_cursor#29 = ((byte*))(word/signed word) 1024 [phi:main->print_str#0] -- zpptrby1=cowo1 @@ -2715,7 +2727,7 @@ main: { b1: //SEG16 [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) //SEG17 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln] - //SEG18 [17] phi (byte*) line_cursor#19 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 + //SEG18 [17] phi (byte*) line_cursor#16 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 lda #<$400 sta line_cursor lda #>$400 @@ -2723,15 +2735,15 @@ main: { jsr print_ln //SEG19 main::@2 b2: - //SEG20 [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + //SEG20 [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG22 [22] phi from main::@2 to print_str [phi:main::@2->print_str] print_str_from_b2: - //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#33 [phi:main::@2->print_str#0] -- register_copy + //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@2->print_str#0] -- register_copy //SEG24 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- zpptrby1=cowo1 lda #print_ln] - //SEG29 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy + //SEG29 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy jsr print_ln //SEG30 main::@4 b4: - //SEG31 [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) -- zpptrby1=zpptrby2 + //SEG31 [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG33 [22] phi from main::@4 to print_str [phi:main::@4->print_str] print_str_from_b4: - //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@4->print_str#0] -- register_copy + //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#35 [phi:main::@4->print_str#0] -- register_copy //SEG35 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- zpptrby1=cowo1 lda #print_ln] - //SEG40 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy + //SEG40 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy jsr print_ln //SEG41 main::@return breturn: @@ -2778,10 +2790,10 @@ main: { print_ln: { .label _0 = 2 //SEG44 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] - //SEG45 [18] phi (byte*) line_cursor#12 = (byte*) line_cursor#19 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG45 [18] phi (byte*) line_cursor#8 = (byte*) line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy //SEG46 print_ln::@1 b1: - //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1=zpptrby1_plus_coby1 + //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1=zpptrby1_plus_coby1 lda _0 clc adc #$28 @@ -2789,7 +2801,7 @@ print_ln: { bcc !+ inc _0+1 !: - //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1_lt_zpptrby2_then_la1 lda _0+1 cmp char_cursor+1 bcc b1 @@ -2807,31 +2819,31 @@ print_ln: { print_str: { .label str = 4 //SEG52 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] - //SEG53 [23] phi (byte*) char_cursor#20 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy + //SEG53 [23] phi (byte*) char_cursor#13 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy //SEG54 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy //SEG55 print_str::@1 b1: - //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 + //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 ldy #0 lda (str),y cmp #'@' bne b2 //SEG57 print_str::@return breturn: - //SEG58 [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + //SEG58 [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) rts //SEG59 print_str::@2 b2: - //SEG60 [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 + //SEG60 [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 ldy #0 lda (str),y sta (char_cursor),y - //SEG61 [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG61 [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc char_cursor bne !+ inc char_cursor+1 !: - //SEG62 [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG62 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc str bne !+ inc str+1 @@ -2874,7 +2886,7 @@ ASSEMBLER //SEG8 @end //SEG9 main main: { - //SEG10 [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + //SEG10 [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) //SEG11 [22] phi from main to print_str [phi:main->print_str] //SEG12 [22] phi (byte*) char_cursor#29 = ((byte*))(word/signed word) 1024 [phi:main->print_str#0] -- zpptrby1=cowo1 lda #<$400 @@ -2891,21 +2903,21 @@ main: { //SEG15 main::@1 //SEG16 [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) //SEG17 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln] - //SEG18 [17] phi (byte*) line_cursor#19 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 + //SEG18 [17] phi (byte*) line_cursor#16 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 lda #<$400 sta line_cursor lda #>$400 sta line_cursor+1 jsr print_ln //SEG19 main::@2 - //SEG20 [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + //SEG20 [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG22 [22] phi from main::@2 to print_str [phi:main::@2->print_str] - //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#33 [phi:main::@2->print_str#0] -- register_copy + //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@2->print_str#0] -- register_copy //SEG24 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- zpptrby1=cowo1 lda #print_ln] - //SEG29 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy + //SEG29 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy jsr print_ln //SEG30 main::@4 - //SEG31 [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) -- zpptrby1=zpptrby2 + //SEG31 [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG33 [22] phi from main::@4 to print_str [phi:main::@4->print_str] - //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@4->print_str#0] -- register_copy + //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#35 [phi:main::@4->print_str#0] -- register_copy //SEG35 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- zpptrby1=cowo1 lda #print_ln] - //SEG40 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy + //SEG40 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy jsr print_ln //SEG41 main::@return //SEG42 [16] return [ ] ( main:2 [ ] ) @@ -2947,10 +2959,10 @@ main: { print_ln: { .label _0 = 2 //SEG44 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] - //SEG45 [18] phi (byte*) line_cursor#12 = (byte*) line_cursor#19 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG45 [18] phi (byte*) line_cursor#8 = (byte*) line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy //SEG46 print_ln::@1 b1: - //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1=zpptrby1_plus_coby1 + //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1=zpptrby1_plus_coby1 lda _0 clc adc #$28 @@ -2958,7 +2970,7 @@ print_ln: { bcc !+ inc _0+1 !: - //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1_lt_zpptrby2_then_la1 lda _0+1 cmp char_cursor+1 bcc b1 @@ -2975,30 +2987,30 @@ print_ln: { print_str: { .label str = 4 //SEG52 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] - //SEG53 [23] phi (byte*) char_cursor#20 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy + //SEG53 [23] phi (byte*) char_cursor#13 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy //SEG54 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy //SEG55 print_str::@1 b1: - //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 + //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 ldy #0 lda (str),y cmp #'@' bne b2 //SEG57 print_str::@return - //SEG58 [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + //SEG58 [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) rts //SEG59 print_str::@2 b2: - //SEG60 [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 + //SEG60 [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 ldy #0 lda (str),y sta (char_cursor),y - //SEG61 [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG61 [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc char_cursor bne !+ inc char_cursor+1 !: - //SEG62 [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG62 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc str bne !+ inc str+1 @@ -3011,14 +3023,14 @@ FINAL SYMBOL TABLE (label) @begin (label) @end (byte*) char_cursor -(byte*) char_cursor#20 char_cursor zp ZP_PTR_BYTE:6 3.2857142857142856 +(byte*) char_cursor#1 char_cursor zp ZP_PTR_BYTE:6 11.0 +(byte*) char_cursor#13 char_cursor zp ZP_PTR_BYTE:6 3.2857142857142856 (byte*) char_cursor#29 char_cursor zp ZP_PTR_BYTE:6 6.0 -(byte*~) char_cursor#33 char_cursor zp ZP_PTR_BYTE:6 4.0 (byte*~) char_cursor#34 char_cursor zp ZP_PTR_BYTE:6 4.0 -(byte*) char_cursor#8 char_cursor zp ZP_PTR_BYTE:6 11.0 +(byte*~) char_cursor#35 char_cursor zp ZP_PTR_BYTE:6 4.0 (byte*) line_cursor -(byte*) line_cursor#12 line_cursor zp ZP_PTR_BYTE:2 24.0 -(byte*) line_cursor#19 line_cursor zp ZP_PTR_BYTE:2 6.0 +(byte*) line_cursor#16 line_cursor zp ZP_PTR_BYTE:2 6.0 +(byte*) line_cursor#8 line_cursor zp ZP_PTR_BYTE:2 24.0 (void()) main() (label) main::@1 (label) main::@2 @@ -3041,13 +3053,13 @@ FINAL SYMBOL TABLE (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#3 str zp ZP_PTR_BYTE:4 22.0 +(byte*) print_str::str#0 str zp ZP_PTR_BYTE:4 22.0 (byte*) print_str::str#4 str zp ZP_PTR_BYTE:4 11.5 (byte*) print_str::str#6 str zp ZP_PTR_BYTE:4 2.0 -zp ZP_PTR_BYTE:2 [ line_cursor#12 line_cursor#19 print_ln::$0 ] -zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#3 ] -zp ZP_PTR_BYTE:6 [ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] +zp ZP_PTR_BYTE:2 [ line_cursor#8 line_cursor#16 print_ln::$0 ] +zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] +zp ZP_PTR_BYTE:6 [ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] FINAL CODE //SEG0 Basic Upstart @@ -3070,7 +3082,7 @@ FINAL CODE //SEG8 @end //SEG9 main main: { - //SEG10 [5] call print_str param-assignment [ char_cursor#20 ] ( main:2 [ char_cursor#20 ] ) + //SEG10 [5] call print_str param-assignment [ char_cursor#13 ] ( main:2 [ char_cursor#13 ] ) //SEG11 [22] phi from main to print_str [phi:main->print_str] //SEG12 [22] phi (byte*) char_cursor#29 = ((byte*))(word/signed word) 1024 [phi:main->print_str#0] -- zpptrby1=cowo1 lda #<$400 @@ -3087,21 +3099,21 @@ main: { //SEG15 main::@1 //SEG16 [7] call print_ln param-assignment [ print_ln::$0 ] ( main:2 [ print_ln::$0 ] ) //SEG17 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln] - //SEG18 [17] phi (byte*) line_cursor#19 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 + //SEG18 [17] phi (byte*) line_cursor#16 = ((byte*))(word/signed word) 1024 [phi:main::@1->print_ln#0] -- zpptrby1=cowo1 lda #<$400 sta line_cursor lda #>$400 sta line_cursor+1 jsr print_ln //SEG19 main::@2 - //SEG20 [8] (byte*~) char_cursor#33 ← (byte*~) print_ln::$0 [ char_cursor#33 print_ln::$0 ] ( main:2 [ char_cursor#33 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + //SEG20 [8] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ char_cursor#34 print_ln::$0 ] ( main:2 [ char_cursor#34 print_ln::$0 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG21 [9] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG22 [22] phi from main::@2 to print_str [phi:main::@2->print_str] - //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#33 [phi:main::@2->print_str#0] -- register_copy + //SEG23 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@2->print_str#0] -- register_copy //SEG24 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- zpptrby1=cowo1 lda #print_ln] - //SEG29 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy + //SEG29 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@3->print_ln#0] -- register_copy jsr print_ln //SEG30 main::@4 - //SEG31 [12] (byte*~) char_cursor#34 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#34 ] ( main:2 [ print_ln::$0 char_cursor#34 ] ) -- zpptrby1=zpptrby2 + //SEG31 [12] (byte*~) char_cursor#35 ← (byte*~) print_ln::$0 [ print_ln::$0 char_cursor#35 ] ( main:2 [ print_ln::$0 char_cursor#35 ] ) -- zpptrby1=zpptrby2 lda print_ln._0 sta char_cursor lda print_ln._0+1 sta char_cursor+1 - //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#20 ] ( main:2 [ print_ln::$0 char_cursor#20 ] ) + //SEG32 [13] call print_str param-assignment [ print_ln::$0 char_cursor#13 ] ( main:2 [ print_ln::$0 char_cursor#13 ] ) //SEG33 [22] phi from main::@4 to print_str [phi:main::@4->print_str] - //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#34 [phi:main::@4->print_str#0] -- register_copy + //SEG34 [22] phi (byte*) char_cursor#29 = (byte*~) char_cursor#35 [phi:main::@4->print_str#0] -- register_copy //SEG35 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- zpptrby1=cowo1 lda #print_ln] - //SEG40 [17] phi (byte*) line_cursor#19 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy + //SEG40 [17] phi (byte*) line_cursor#16 = (byte*~) print_ln::$0 [phi:main::@5->print_ln#0] -- register_copy jsr print_ln //SEG41 main::@return //SEG42 [16] return [ ] ( main:2 [ ] ) @@ -3143,10 +3155,10 @@ main: { print_ln: { .label _0 = 2 //SEG44 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] - //SEG45 [18] phi (byte*) line_cursor#12 = (byte*) line_cursor#19 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG45 [18] phi (byte*) line_cursor#8 = (byte*) line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy //SEG46 print_ln::@1 b1: - //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#12 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1=zpptrby1_plus_coby1 + //SEG47 [19] (byte*~) print_ln::$0 ← (byte*) line_cursor#8 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1=zpptrby1_plus_coby1 lda _0 clc adc #$28 @@ -3154,7 +3166,7 @@ print_ln: { bcc !+ inc _0+1 !: - //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#20) goto print_ln::@1 [ print_ln::$0 char_cursor#20 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#20 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#20 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + //SEG48 [20] if((byte*~) print_ln::$0<(byte*) char_cursor#13) goto print_ln::@1 [ print_ln::$0 char_cursor#13 ] ( main:2::print_ln:7 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:11 [ print_ln::$0 char_cursor#13 ] main:2::print_ln:15 [ print_ln::$0 char_cursor#13 ] ) -- zpptrby1_lt_zpptrby2_then_la1 lda _0+1 cmp char_cursor+1 bcc b1 @@ -3171,30 +3183,30 @@ print_ln: { print_str: { .label str = 4 //SEG52 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] - //SEG53 [23] phi (byte*) char_cursor#20 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy + //SEG53 [23] phi (byte*) char_cursor#13 = (byte*) char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy //SEG54 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy //SEG55 print_str::@1 b1: - //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 + //SEG56 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1_neq_coby1_then_la1 ldy #0 lda (str),y cmp #'@' bne b2 //SEG57 print_str::@return - //SEG58 [25] return [ char_cursor#20 ] ( main:2::print_str:5 [ char_cursor#20 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 ] ) + //SEG58 [25] return [ char_cursor#13 ] ( main:2::print_str:5 [ char_cursor#13 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 ] ) rts //SEG59 print_str::@2 b2: - //SEG60 [26] *((byte*) char_cursor#20) ← *((byte*) print_str::str#4) [ char_cursor#20 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#20 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#20 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#20 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 + //SEG60 [26] *((byte*) char_cursor#13) ← *((byte*) print_str::str#4) [ char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_ln::$0 char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_ln::$0 char_cursor#13 print_str::str#4 ] ) -- _deref_zpptrby1=_deref_zpptrby2 ldy #0 lda (str),y sta (char_cursor),y - //SEG61 [27] (byte*) char_cursor#8 ← ++ (byte*) char_cursor#20 [ print_str::str#4 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG61 [27] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#13 [ print_str::str#4 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#4 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#4 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#4 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc char_cursor bne !+ inc char_cursor+1 !: - //SEG62 [28] (byte*) print_str::str#3 ← ++ (byte*) print_str::str#4 [ print_str::str#3 char_cursor#8 ] ( main:2::print_str:5 [ print_str::str#3 char_cursor#8 ] main:2::print_str:9 [ print_ln::$0 print_str::str#3 char_cursor#8 ] main:2::print_str:13 [ print_ln::$0 print_str::str#3 char_cursor#8 ] ) -- zpptrby1=_inc_zpptrby1 + //SEG62 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:5 [ print_str::str#0 char_cursor#1 ] main:2::print_str:9 [ print_ln::$0 print_str::str#0 char_cursor#1 ] main:2::print_str:13 [ print_ln::$0 print_str::str#0 char_cursor#1 ] ) -- zpptrby1=_inc_zpptrby1 inc str bne !+ inc str+1 diff --git a/src/main/java/dk/camelot64/kickc/test/ref/print.sym b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym similarity index 65% rename from src/main/java/dk/camelot64/kickc/test/ref/print.sym rename to src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym index e593e6b99..bd4a90312 100644 --- a/src/main/java/dk/camelot64/kickc/test/ref/print.sym +++ b/src/main/java/dk/camelot64/kickc/test/ref/printmsg.sym @@ -2,14 +2,14 @@ (label) @begin (label) @end (byte*) char_cursor -(byte*) char_cursor#20 char_cursor zp ZP_PTR_BYTE:6 3.2857142857142856 +(byte*) char_cursor#1 char_cursor zp ZP_PTR_BYTE:6 11.0 +(byte*) char_cursor#13 char_cursor zp ZP_PTR_BYTE:6 3.2857142857142856 (byte*) char_cursor#29 char_cursor zp ZP_PTR_BYTE:6 6.0 -(byte*~) char_cursor#33 char_cursor zp ZP_PTR_BYTE:6 4.0 (byte*~) char_cursor#34 char_cursor zp ZP_PTR_BYTE:6 4.0 -(byte*) char_cursor#8 char_cursor zp ZP_PTR_BYTE:6 11.0 +(byte*~) char_cursor#35 char_cursor zp ZP_PTR_BYTE:6 4.0 (byte*) line_cursor -(byte*) line_cursor#12 line_cursor zp ZP_PTR_BYTE:2 24.0 -(byte*) line_cursor#19 line_cursor zp ZP_PTR_BYTE:2 6.0 +(byte*) line_cursor#16 line_cursor zp ZP_PTR_BYTE:2 6.0 +(byte*) line_cursor#8 line_cursor zp ZP_PTR_BYTE:2 24.0 (void()) main() (label) main::@1 (label) main::@2 @@ -32,10 +32,10 @@ (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#3 str zp ZP_PTR_BYTE:4 22.0 +(byte*) print_str::str#0 str zp ZP_PTR_BYTE:4 22.0 (byte*) print_str::str#4 str zp ZP_PTR_BYTE:4 11.5 (byte*) print_str::str#6 str zp ZP_PTR_BYTE:4 2.0 -zp ZP_PTR_BYTE:2 [ line_cursor#12 line_cursor#19 print_ln::$0 ] -zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#3 ] -zp ZP_PTR_BYTE:6 [ char_cursor#20 char_cursor#29 char_cursor#33 char_cursor#34 char_cursor#8 ] +zp ZP_PTR_BYTE:2 [ line_cursor#8 line_cursor#16 print_ln::$0 ] +zp ZP_PTR_BYTE:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] +zp ZP_PTR_BYTE:6 [ char_cursor#13 char_cursor#29 char_cursor#34 char_cursor#35 char_cursor#1 ] diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.asm b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.asm new file mode 100644 index 000000000..992686ee9 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.asm @@ -0,0 +1,214 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + .const memLo = $fe + .const memHi = $ff + .const f_2pi = $e2e5 + .label char_cursor = 5 + .label line_cursor = 3 + hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + f_i: .byte 0, 0, 0, 0, 0 + f_127: .byte 0, 0, 0, 0, 0 + jsr main +main: { + .label _2 = 9 + .label _11 = 9 + .label i = 2 + lda #$7f + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + lda #f_127 + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + lda #<$400 + sta line_cursor + lda #>$400 + sta line_cursor+1 + lda #<$400 + sta char_cursor + lda #>$400 + sta char_cursor+1 + lda #1 + sta i + b1: + lda i + sta _2 + lda #0 + sta _2+1 + jsr setFAC + lda #f_2pi + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + lda #f_i + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + lda #$19 + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + jsr divMEMbyFAC + jsr sinFAC + lda #f_127 + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + jsr addMEMtoFAC + jsr getFAC + jsr print_word + jsr print_ln + inc i + lda i + cmp #$1a + bne b16 + rts + b16: + lda print_ln._0 + sta char_cursor + lda print_ln._0+1 + sta char_cursor+1 + jmp b1 +} +print_ln: { + .label _0 = 3 + b1: + lda _0 + clc + adc #$28 + sta _0 + bcc !+ + inc _0+1 + !: + lda _0+1 + cmp char_cursor+1 + bcc b1 + bne !+ + lda _0 + cmp char_cursor + bcc b1 + !: + rts +} +print_word: { + .label w = 9 + lda w+1 + tax + jsr print_byte + lda w + tax + jsr print_byte + rts +} +print_byte: { + txa + lsr + lsr + lsr + lsr + tay + lda hextab,y + jsr print_char + txa + and #$f + tax + lda hextab,x + jsr print_char + rts +} +print_char: { + ldy #0 + sta (char_cursor),y + inc char_cursor + bne !+ + inc char_cursor+1 + !: + rts +} +getFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + .label return = 9 + jsr $b1aa + sty $fe + sta $ff + lda lo + sta w + lda #0 + sta w+1 + lda hi + sta return+1 + rts +} +addMEMtoFAC: { + lda #f_127 + sta prepareMEM.mem+1 + jsr prepareMEM + lda $fe + ldy $ff + jsr $b867 + rts +} +prepareMEM: { + .label mem = 7 + lda mem + sta memLo + lda mem+1 + sta memHi + rts +} +mulFACbyMEM: { + .label mem = 7 + jsr prepareMEM + lda $fe + ldy $ff + jsr $ba28 + rts +} +sinFAC: { + jsr $e26b + rts +} +divMEMbyFAC: { + lda #f_i + sta prepareMEM.mem+1 + jsr prepareMEM + lda $fe + ldy $ff + jsr $bb0f + rts +} +setFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + lda w + sta lo + lda w+1 + sta hi + ldy $fe + lda $ff + jsr $b391 + rts +} +setMEMtoFAC: { + .label mem = 7 + jsr prepareMEM + ldx $fe + ldy $ff + jsr $bbd4 + rts +} diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg new file mode 100644 index 000000000..86051b6c1 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.cfg @@ -0,0 +1,204 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@31 +@31: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main param-assignment [ ] ( ) + to:@end +@end: scope:[] from @31 + [3] phi() [ ] ( ) +main: scope:[main] from @31 + [4] phi() [ ] ( main:2 [ ] ) + [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + to:main::@3 +main::@3: scope:[main] from main + [6] phi() [ ] ( main:2 [ ] ) + [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main::@16 main::@3 + [8] (byte*) line_cursor#13 ← phi( main::@16/(byte*~) print_ln::$0 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [8] (byte*) char_cursor#32 ← phi( main::@16/(byte*~) char_cursor#49 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [8] (byte) main::i#10 ← phi( main::@16/(byte) main::i#1 main::@3/(byte/signed byte/word/signed word) 1 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) + [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) + [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@5 +main::@5: scope:[main] from main::@1 + [12] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@6 +main::@6: scope:[main] from main::@5 + [14] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@7 +main::@7: scope:[main] from main::@6 + [16] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@8 +main::@8: scope:[main] from main::@7 + [18] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@9 +main::@9: scope:[main] from main::@8 + [20] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@10 +main::@10: scope:[main] from main::@9 + [22] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@11 +main::@11: scope:[main] from main::@10 + [24] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@12 +main::@12: scope:[main] from main::@11 + [26] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) + to:main::@13 +main::@13: scope:[main] from main::@12 + [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) + [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) + [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:main::@14 +main::@14: scope:[main] from main::@13 + [32] phi() [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + to:main::@15 +main::@15: scope:[main] from main::@14 + [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) + [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) + to:main::@return +main::@return: scope:[main] from main::@15 + [36] return [ ] ( main:2 [ ] ) + to:@return +main::@16: scope:[main] from main::@15 + [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) + to:main::@1 +print_ln: scope:[print_ln] from main::@14 + [38] phi() [ line_cursor#13 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [39] (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#6 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 line_cursor#6 char_cursor#10 ] ) + [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) + [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + to:@return +print_word: scope:[print_word] from main::@13 + [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) + [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) + [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) + [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) + [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + [50] (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) [ print_byte::b#2 char_cursor#31 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 ] ) + [50] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) [ print_byte::b#2 char_cursor#31 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 ] ) + [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) + [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) + [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) + [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) + [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) + [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) + [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + [60] (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) [ print_char::ch#2 char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 print_char::ch#2 char_cursor#23 ] ) + [60] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) [ print_char::ch#2 char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 print_char::ch#2 char_cursor#23 ] ) + [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) + [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) + [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + [68] phi() [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + [72] (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) + [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) + [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) + [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) + [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + [78] (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte[]) f_127#0 main::@5/(const byte*) f_2pi#0 ) [ mulFACbyMEM::mem#2 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] ) + [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) + [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + [85] phi() [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + [89] (word) setFAC::w#3 ← phi( main/(byte/signed byte/word/signed word) 127 main::@1/(word) setFAC::w#1 main::@7/(byte/signed byte/word/signed word) 25 ) [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) + [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) + [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) + [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) + [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + [96] (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte[]) f_127#0 main::@6/(const byte[]) f_i#0 ) [ setMEMtoFAC::mem#2 ] ( main:2::setMEMtoFAC:7 [ setMEMtoFAC::mem#2 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 setMEMtoFAC::mem#2 ] ) + [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) + [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log new file mode 100644 index 000000000..a09d81be7 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.log @@ -0,0 +1,9235 @@ +import "print" +import "basic-floats" + +byte[] f_i = {0, 0, 0, 0, 0}; +byte[] f_127 = {0, 0, 0, 0, 0}; +byte* f_2pi = $e2e5; + +void main() { + setFAC(127); + setMEMtoFAC(f_127); + for(byte i : 1..25) { + setFAC((word)i); + mulFACbyMEM(f_2pi); + setMEMtoFAC(f_i); + setFAC(25); + divMEMbyFAC(f_i); + sinFAC(); + mulFACbyMEM(f_127); + addMEMtoFAC(f_127); + print_word(getFAC()); + print_ln(); + } +} + +Importing print + +byte* line_cursor = $0400; +byte* char_cursor = line_cursor; + +// Print a zero-terminated string +void print_str(byte* str) { + while(*str!='@') { + *(char_cursor++) = *(str++); + } +} + +// Print a newline +void print_ln() { + do { + line_cursor = line_cursor + $28; + } while (line_cursorw); + print_byte(>4]); + print_char(hextab[b&$f]); +} + +// Print a single char +void print_char(byte ch) { + *(char_cursor++) = ch; +} + + +Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor +Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str +Adding pre/post-modifier (byte*) char_cursor ← ++ (byte*) char_cursor +Importing basic-floats +// Library wrapping the BASIC floating point functions +// See https://www.c64-wiki.com/wiki/Floating_point_arithmetic +// See http://www.pagetable.com/c64rom/c64rom_sc.html + +// FAC = word +// Set the FAC (floating point accumulator) to the integer value of a 16bit word +void setFAC(word w) { + const byte* lo = $fe; + const byte* hi = $ff; + *lo = w; + // Load word register Y,A into FAC (floating point accumulator) + asm { + ldy $fe + lda $ff + jsr $b391 + } +} + +// word = FAC +// Get the value of the FAC (floating point accumulator) as an integer 16bit word +// Destroys the value in the FAC in the process +word getFAC() { + const byte* lo = $fe; + const byte* hi = $ff; + // Load FAC (floating point accumulator) integer part into word register Y,A + asm { + jsr $b1aa + sty $fe + sta $ff + } + word w = 0; + w = *hi; + return w; +} + +// ARG = FAC +// Set the ARG (floating point argument) to the value of the FAC (floating point accumulator) +void setARGtoFAC() { + asm { + jsr $bc0f + } +} + +// FAC = ARG +// Set the FAC (floating point accumulator) to the value of the ARG (floating point argument) +void setFACtoARG() { + asm { + jsr $bbfc + } +} + +// Zeropage addresses used to hold lo/hi-bytes of addresses of float numbers in MEM +const byte* memLo = $fe; +const byte* memHi = $ff; + +// Prepare MEM pointers for operations using MEM +void prepareMEM(byte* mem) { + *memLo = mem; +} + +// MEM = FAC +// Stores the value of the FAC to memory +// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};) +void setMEMtoFAC(byte* mem) { + prepareMEM(mem); + asm { + ldx $fe + ldy $ff + jsr $bbd4 + } +} + +// FAC = MEM +// Set the FAC to value from MEM (float saved in memory) +// Reads 5 bytes +void setFACtoMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $bba2 + } +} + +// FAC = PI/2 +// Set the FAC to PI/2 +// Reads 5 bytes from the BASIC ROM +void setFACtoPIhalf() { + asm { + lda #$e0 + ldy #$e2 + jsr $bba2 + } +} + +// FAC = 2*PI +// Set the FAC to 2*PI +// Reads 5 bytes from the BASIC ROM +void setFACto2PI() { + asm { + lda #$e5 + ldy #$e2 + jsr $bba2 + } +} + +// ARG = MEM +// Load the ARG from memory +// Reads 5 bytes +void setARGtoMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $ba8c + } +} + +// FAC = MEM+FAC +// Set FAC to MEM (float saved in memory) plus FAC (float accumulator) +// Reads 5 bytes from memory +void addMEMtoFAC(byte* mem) { + prepareMEM(mem); + asm { + lda $fe //memLo + ldy $ff //memHi + jsr $b867 + } +} + +// FAC = ARG+FAC +// Add ARG (floating point argument) to FAC (floating point accumulator) +void addARGtoFAC() { + asm { + jsr $b86a + } +} + +// FAC = MEM-FAC +// Set FAC to MEM (float saved in memory) minus FAC (float accumulator) +// Reads 5 bytes from memory +void subFACfromMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $b850 + } +} + +// FAC = ARG-FAC +// Set FAC to ARG minus FAC +void subFACfromARG() { + asm { + jsr $b853 + } +} + +// FAC = MEM/FAC +// Set FAC to MEM (float saved in memory) divided by FAC (float accumulator) +// Reads 5 bytes from memory +void divMEMbyFAC(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $bb0f + } +} + +// FAC = MEM*FAC +// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator) +// Reads 5 bytes from memory +void mulFACbyMEM(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $ba28 + } +} + +// FAC = MEM^FAC +// Set FAC to MEM (float saved in memory) raised to power of FAC (float accumulator) +// Reads 5 bytes from memory +void pwrMEMbyFAC(byte* mem) { + prepareMEM(mem); + asm { + lda $fe + ldy $ff + jsr $bf78 + } +} + +// FAC = int(FAC) +// Set FAC to integer part of the FAC - int(FAC) +// The integer part is defined as the next lower integer - like java floor() +void intFAC() { + asm { + jsr $bccc + } +} + +// FAC = sin(FAC) +// Set FAC to sinus of the FAC - sin(FAC) +// Sinus is calculated on radians (0-2*PI) +void sinFAC() { + asm { + jsr $e26b + } +} + +// FAC = cos(FAC) +// Set FAC to cosinus of the FAC - cos(FAC) +// Cosinus is calculated on radians (0-2*PI) +void cosFAC() { + asm { + jsr $e264 + } +} + +// FAC = tan(FAC) +// Set FAC to the tangens of FAC - tan(FAC) +// Tangens is calculated on radians (0-2*PI) +void tanFAC() { + asm { + jsr $e2b4 + } +} + +// FAC = atn(FAC) +// Set FAC to the arc tangens of FAC - atn(FAC) +// Arc Tangens is calculated on radians (0-2*PI) +void atnFAC() { + asm { + jsr $e303 + } +} + +// FAC = sqr(FAC) +// Set FAC to the square root of FAC - sqr(FAC) +void sqrFAC() { + asm { + jsr $bf71 + } +} + +// FAC = exp(FAC) +// Set FAC to the exponential function of FAC - exp(FAC) +// Exp is based on the natural logarithm e=2.71828183 +void expFAC() { + asm { + jsr $bfed + } +} + +// FAC = log(FAC) +// Set FAC to the logarithm of FAC - log(FAC) +// Log is based on the natural logarithm e=2.71828183 +void logFAC() { + asm { + jsr $b9ea + } +} + +Fixing lo/hi-lvalue lo=(getFAC::w) ← *(getFAC::lo) +Fixing lo/hi-lvalue hi=(getFAC::w) ← *(getFAC::hi) +PROGRAM + (byte*) line_cursor ← (word/signed word) 1024 + (byte*) char_cursor ← (byte*) line_cursor +proc (void()) print_str((byte*) print_str::str) +print_str::@1: + (boolean~) print_str::$0 ← *((byte*) print_str::str) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + goto print_str::@3 +print_str::@2: + *((byte*) char_cursor) ← *((byte*) print_str::str) + (byte*) char_cursor ← ++ (byte*) char_cursor + (byte*) print_str::str ← ++ (byte*) print_str::str + goto print_str::@1 +print_str::@3: +print_str::@return: + return +endproc // print_str() +proc (void()) print_ln() +print_ln::@1: + (byte*~) print_ln::$0 ← (byte*) line_cursor + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor < (byte*) char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + (byte*) char_cursor ← (byte*) line_cursor +print_ln::@return: + return +endproc // print_ln() +proc (void()) print_word((word) print_word::w) + (byte~) print_word::$0 ← > (word) print_word::w + (void~) print_word::$1 ← call print_byte (byte~) print_word::$0 + (byte~) print_word::$2 ← < (word) print_word::w + (void~) print_word::$3 ← call print_byte (byte~) print_word::$2 +print_word::@return: + return +endproc // print_word() + (byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } +proc (void()) print_byte((byte) print_byte::b) + (byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab *idx (byte~) print_byte::$0 + (void~) print_byte::$2 ← call print_char (byte~) print_byte::$1 + (byte~) print_byte::$3 ← (byte) print_byte::b & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab *idx (byte~) print_byte::$3 + (void~) print_byte::$5 ← call print_char (byte~) print_byte::$4 +print_byte::@return: + return +endproc // print_byte() +proc (void()) print_char((byte) print_char::ch) + *((byte*) char_cursor) ← (byte) print_char::ch + (byte*) char_cursor ← ++ (byte*) char_cursor +print_char::@return: + return +endproc // print_char() +proc (void()) setFAC((word) setFAC::w) + (byte*) setFAC::lo ← (byte/word/signed word) 254 + (byte*) setFAC::hi ← (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w + *((byte*) setFAC::lo) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w + *((byte*) setFAC::hi) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } +setFAC::@return: + return +endproc // setFAC() +proc (word()) getFAC() + (byte*) getFAC::lo ← (byte/word/signed word) 254 + (byte*) getFAC::hi ← (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w ← (word) getFAC::w lo= *((byte*) getFAC::lo) + (word) getFAC::w ← (word) getFAC::w hi= *((byte*) getFAC::hi) + (word) getFAC::return ← (word) getFAC::w + goto getFAC::@return +getFAC::@return: + (word) getFAC::return ← (word) getFAC::return + return (word) getFAC::return +endproc // getFAC() +proc (void()) setARGtoFAC() + asm { jsr$bc0f } +setARGtoFAC::@return: + return +endproc // setARGtoFAC() +proc (void()) setFACtoARG() + asm { jsr$bbfc } +setFACtoARG::@return: + return +endproc // setFACtoARG() + (byte*) memLo ← (byte/word/signed word) 254 + (byte*) memHi ← (byte/word/signed word) 255 +proc (void()) prepareMEM((byte*) prepareMEM::mem) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem + *((byte*) memLo) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem + *((byte*) memHi) ← (byte~) prepareMEM::$1 +prepareMEM::@return: + return +endproc // prepareMEM() +proc (void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) + (void~) setMEMtoFAC::$0 ← call prepareMEM (byte*) setMEMtoFAC::mem + asm { ldx$feldy$ffjsr$bbd4 } +setMEMtoFAC::@return: + return +endproc // setMEMtoFAC() +proc (void()) setFACtoMEM((byte*) setFACtoMEM::mem) + (void~) setFACtoMEM::$0 ← call prepareMEM (byte*) setFACtoMEM::mem + asm { lda$feldy$ffjsr$bba2 } +setFACtoMEM::@return: + return +endproc // setFACtoMEM() +proc (void()) setFACtoPIhalf() + asm { lda#$e0ldy#$e2jsr$bba2 } +setFACtoPIhalf::@return: + return +endproc // setFACtoPIhalf() +proc (void()) setFACto2PI() + asm { lda#$e5ldy#$e2jsr$bba2 } +setFACto2PI::@return: + return +endproc // setFACto2PI() +proc (void()) setARGtoMEM((byte*) setARGtoMEM::mem) + (void~) setARGtoMEM::$0 ← call prepareMEM (byte*) setARGtoMEM::mem + asm { lda$feldy$ffjsr$ba8c } +setARGtoMEM::@return: + return +endproc // setARGtoMEM() +proc (void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) + (void~) addMEMtoFAC::$0 ← call prepareMEM (byte*) addMEMtoFAC::mem + asm { lda$feldy$ffjsr$b867 } +addMEMtoFAC::@return: + return +endproc // addMEMtoFAC() +proc (void()) addARGtoFAC() + asm { jsr$b86a } +addARGtoFAC::@return: + return +endproc // addARGtoFAC() +proc (void()) subFACfromMEM((byte*) subFACfromMEM::mem) + (void~) subFACfromMEM::$0 ← call prepareMEM (byte*) subFACfromMEM::mem + asm { lda$feldy$ffjsr$b850 } +subFACfromMEM::@return: + return +endproc // subFACfromMEM() +proc (void()) subFACfromARG() + asm { jsr$b853 } +subFACfromARG::@return: + return +endproc // subFACfromARG() +proc (void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) + (void~) divMEMbyFAC::$0 ← call prepareMEM (byte*) divMEMbyFAC::mem + asm { lda$feldy$ffjsr$bb0f } +divMEMbyFAC::@return: + return +endproc // divMEMbyFAC() +proc (void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) + (void~) mulFACbyMEM::$0 ← call prepareMEM (byte*) mulFACbyMEM::mem + asm { lda$feldy$ffjsr$ba28 } +mulFACbyMEM::@return: + return +endproc // mulFACbyMEM() +proc (void()) pwrMEMbyFAC((byte*) pwrMEMbyFAC::mem) + (void~) pwrMEMbyFAC::$0 ← call prepareMEM (byte*) pwrMEMbyFAC::mem + asm { lda$feldy$ffjsr$bf78 } +pwrMEMbyFAC::@return: + return +endproc // pwrMEMbyFAC() +proc (void()) intFAC() + asm { jsr$bccc } +intFAC::@return: + return +endproc // intFAC() +proc (void()) sinFAC() + asm { jsr$e26b } +sinFAC::@return: + return +endproc // sinFAC() +proc (void()) cosFAC() + asm { jsr$e264 } +cosFAC::@return: + return +endproc // cosFAC() +proc (void()) tanFAC() + asm { jsr$e2b4 } +tanFAC::@return: + return +endproc // tanFAC() +proc (void()) atnFAC() + asm { jsr$e303 } +atnFAC::@return: + return +endproc // atnFAC() +proc (void()) sqrFAC() + asm { jsr$bf71 } +sqrFAC::@return: + return +endproc // sqrFAC() +proc (void()) expFAC() + asm { jsr$bfed } +expFAC::@return: + return +endproc // expFAC() +proc (void()) logFAC() + asm { jsr$b9ea } +logFAC::@return: + return +endproc // logFAC() + (byte[]) f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi ← (word) 58085 +proc (void()) main() + (void~) main::$0 ← call setFAC (byte/signed byte/word/signed word) 127 + (void~) main::$1 ← call setMEMtoFAC (byte[]) f_127 + (byte) main::i ← (byte/signed byte/word/signed word) 1 +main::@1: + (word~) main::$2 ← ((word)) (byte) main::i + (void~) main::$3 ← call setFAC (word~) main::$2 + (void~) main::$4 ← call mulFACbyMEM (byte*) f_2pi + (void~) main::$5 ← call setMEMtoFAC (byte[]) f_i + (void~) main::$6 ← call setFAC (byte/signed byte/word/signed word) 25 + (void~) main::$7 ← call divMEMbyFAC (byte[]) f_i + (void~) main::$8 ← call sinFAC + (void~) main::$9 ← call mulFACbyMEM (byte[]) f_127 + (void~) main::$10 ← call addMEMtoFAC (byte[]) f_127 + (word~) main::$11 ← call getFAC + (void~) main::$12 ← call print_word (word~) main::$11 + (void~) main::$13 ← call print_ln + (byte) main::i ← ++ (byte) main::i + (boolean~) main::$14 ← (byte) main::i != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 +main::@return: + return +endproc // main() + call main + +SYMBOLS +(void()) addARGtoFAC() +(label) addARGtoFAC::@return +(void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) +(void~) addMEMtoFAC::$0 +(label) addMEMtoFAC::@return +(byte*) addMEMtoFAC::mem +(void()) atnFAC() +(label) atnFAC::@return +(byte*) char_cursor +(void()) cosFAC() +(label) cosFAC::@return +(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) +(void~) divMEMbyFAC::$0 +(label) divMEMbyFAC::@return +(byte*) divMEMbyFAC::mem +(void()) expFAC() +(label) expFAC::@return +(byte[]) f_127 +(byte*) f_2pi +(byte[]) f_i +(word()) getFAC() +(label) getFAC::@return +(byte*) getFAC::hi +(byte*) getFAC::lo +(word) getFAC::return +(word) getFAC::w +(byte[]) hextab +(void()) intFAC() +(label) intFAC::@return +(byte*) line_cursor +(void()) logFAC() +(label) logFAC::@return +(void()) main() +(void~) main::$0 +(void~) main::$1 +(void~) main::$10 +(word~) main::$11 +(void~) main::$12 +(void~) main::$13 +(boolean~) main::$14 +(word~) main::$2 +(void~) main::$3 +(void~) main::$4 +(void~) main::$5 +(void~) main::$6 +(void~) main::$7 +(void~) main::$8 +(void~) main::$9 +(label) main::@1 +(label) main::@return +(byte) main::i +(byte*) memHi +(byte*) memLo +(void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) +(void~) mulFACbyMEM::$0 +(label) mulFACbyMEM::@return +(byte*) mulFACbyMEM::mem +(void()) prepareMEM((byte*) prepareMEM::mem) +(byte~) prepareMEM::$0 +(byte~) prepareMEM::$1 +(label) prepareMEM::@return +(byte*) prepareMEM::mem +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 +(byte~) print_byte::$1 +(void~) print_byte::$2 +(byte~) print_byte::$3 +(byte~) print_byte::$4 +(void~) print_byte::$5 +(label) print_byte::@return +(byte) print_byte::b +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(void()) print_ln() +(byte*~) print_ln::$0 +(boolean~) print_ln::$1 +(label) print_ln::@1 +(label) print_ln::@return +(void()) print_str((byte*) print_str::str) +(boolean~) print_str::$0 +(label) print_str::@1 +(label) print_str::@2 +(label) print_str::@3 +(label) print_str::@return +(byte*) print_str::str +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 +(void~) print_word::$1 +(byte~) print_word::$2 +(void~) print_word::$3 +(label) print_word::@return +(word) print_word::w +(void()) pwrMEMbyFAC((byte*) pwrMEMbyFAC::mem) +(void~) pwrMEMbyFAC::$0 +(label) pwrMEMbyFAC::@return +(byte*) pwrMEMbyFAC::mem +(void()) setARGtoFAC() +(label) setARGtoFAC::@return +(void()) setARGtoMEM((byte*) setARGtoMEM::mem) +(void~) setARGtoMEM::$0 +(label) setARGtoMEM::@return +(byte*) setARGtoMEM::mem +(void()) setFAC((word) setFAC::w) +(byte~) setFAC::$0 +(byte~) setFAC::$1 +(label) setFAC::@return +(byte*) setFAC::hi +(byte*) setFAC::lo +(word) setFAC::w +(void()) setFACto2PI() +(label) setFACto2PI::@return +(void()) setFACtoARG() +(label) setFACtoARG::@return +(void()) setFACtoMEM((byte*) setFACtoMEM::mem) +(void~) setFACtoMEM::$0 +(label) setFACtoMEM::@return +(byte*) setFACtoMEM::mem +(void()) setFACtoPIhalf() +(label) setFACtoPIhalf::@return +(void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) +(void~) setMEMtoFAC::$0 +(label) setMEMtoFAC::@return +(byte*) setMEMtoFAC::mem +(void()) sinFAC() +(label) sinFAC::@return +(void()) sqrFAC() +(label) sqrFAC::@return +(void()) subFACfromARG() +(label) subFACfromARG::@return +(void()) subFACfromMEM((byte*) subFACfromMEM::mem) +(void~) subFACfromMEM::$0 +(label) subFACfromMEM::@return +(byte*) subFACfromMEM::mem +(void()) tanFAC() +(label) tanFAC::@return + +Promoting word/signed word to byte* in line_cursor ← ((byte*)) 1024 +Promoting byte/word/signed word to byte* in setFAC::lo ← ((byte*)) 254 +Promoting byte/word/signed word to byte* in setFAC::hi ← ((byte*)) 255 +Promoting byte/word/signed word to byte* in getFAC::lo ← ((byte*)) 254 +Promoting byte/word/signed word to byte* in getFAC::hi ← ((byte*)) 255 +Promoting byte/word/signed word to byte* in memLo ← ((byte*)) 254 +Promoting byte/word/signed word to byte* in memHi ← ((byte*)) 255 +Promoting word to byte* in f_2pi ← ((byte*)) 58085 +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor ← (byte*) line_cursor + to:@1 +print_str: scope:[print_str] from + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (boolean~) print_str::$0 ← *((byte*) print_str::str) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@4 +print_str::@2: scope:[print_str] from print_str::@1 print_str::@5 + *((byte*) char_cursor) ← *((byte*) print_str::str) + (byte*) char_cursor ← ++ (byte*) char_cursor + (byte*) print_str::str ← ++ (byte*) print_str::str + to:print_str::@1 +print_str::@4: scope:[print_str] from print_str::@1 + to:print_str::@3 +print_str::@3: scope:[print_str] from print_str::@4 print_str::@6 + to:print_str::@return +print_str::@5: scope:[print_str] from + to:print_str::@2 +print_str::@6: scope:[print_str] from + to:print_str::@3 +print_str::@return: scope:[print_str] from print_str::@3 + return + to:@return +@1: scope:[] from @begin + to:@2 +print_ln: scope:[print_ln] from + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*~) print_ln::$0 ← (byte*) line_cursor + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor < (byte*) char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) char_cursor ← (byte*) line_cursor + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@2: scope:[] from @1 + to:@3 +print_word: scope:[print_word] from + (byte~) print_word::$0 ← > (word) print_word::w + (void~) print_word::$1 ← call print_byte (byte~) print_word::$0 + (byte~) print_word::$2 ← < (word) print_word::w + (void~) print_word::$3 ← call print_byte (byte~) print_word::$2 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word + return + to:@return +@3: scope:[] from @2 + (byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@4 +print_byte: scope:[print_byte] from + (byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab *idx (byte~) print_byte::$0 + (void~) print_byte::$2 ← call print_char (byte~) print_byte::$1 + (byte~) print_byte::$3 ← (byte) print_byte::b & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab *idx (byte~) print_byte::$3 + (void~) print_byte::$5 ← call print_char (byte~) print_byte::$4 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte + return + to:@return +@4: scope:[] from @3 + to:@5 +print_char: scope:[print_char] from + *((byte*) char_cursor) ← (byte) print_char::ch + (byte*) char_cursor ← ++ (byte*) char_cursor + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +@5: scope:[] from @4 + to:@6 +setFAC: scope:[setFAC] from + (byte*) setFAC::lo ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w + *((byte*) setFAC::lo) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w + *((byte*) setFAC::hi) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +@6: scope:[] from @5 + to:@7 +getFAC: scope:[getFAC] from + (byte*) getFAC::lo ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w ← (word) getFAC::w lo= *((byte*) getFAC::lo) + (word) getFAC::w ← (word) getFAC::w hi= *((byte*) getFAC::hi) + (word) getFAC::return ← (word) getFAC::w + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC getFAC::@1 + (word) getFAC::return ← (word) getFAC::return + return (word) getFAC::return + to:@return +getFAC::@1: scope:[getFAC] from + to:getFAC::@return +@7: scope:[] from @6 + to:@8 +setARGtoFAC: scope:[setARGtoFAC] from + asm { jsr$bc0f } + to:setARGtoFAC::@return +setARGtoFAC::@return: scope:[setARGtoFAC] from setARGtoFAC + return + to:@return +@8: scope:[] from @7 + to:@9 +setFACtoARG: scope:[setFACtoARG] from + asm { jsr$bbfc } + to:setFACtoARG::@return +setFACtoARG::@return: scope:[setFACtoARG] from setFACtoARG + return + to:@return +@9: scope:[] from @8 + (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 + to:@10 +prepareMEM: scope:[prepareMEM] from + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem + *((byte*) memLo) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem + *((byte*) memHi) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +@10: scope:[] from @9 + to:@11 +setMEMtoFAC: scope:[setMEMtoFAC] from + (void~) setMEMtoFAC::$0 ← call prepareMEM (byte*) setMEMtoFAC::mem + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC + return + to:@return +@11: scope:[] from @10 + to:@12 +setFACtoMEM: scope:[setFACtoMEM] from + (void~) setFACtoMEM::$0 ← call prepareMEM (byte*) setFACtoMEM::mem + asm { lda$feldy$ffjsr$bba2 } + to:setFACtoMEM::@return +setFACtoMEM::@return: scope:[setFACtoMEM] from setFACtoMEM + return + to:@return +@12: scope:[] from @11 + to:@13 +setFACtoPIhalf: scope:[setFACtoPIhalf] from + asm { lda#$e0ldy#$e2jsr$bba2 } + to:setFACtoPIhalf::@return +setFACtoPIhalf::@return: scope:[setFACtoPIhalf] from setFACtoPIhalf + return + to:@return +@13: scope:[] from @12 + to:@14 +setFACto2PI: scope:[setFACto2PI] from + asm { lda#$e5ldy#$e2jsr$bba2 } + to:setFACto2PI::@return +setFACto2PI::@return: scope:[setFACto2PI] from setFACto2PI + return + to:@return +@14: scope:[] from @13 + to:@15 +setARGtoMEM: scope:[setARGtoMEM] from + (void~) setARGtoMEM::$0 ← call prepareMEM (byte*) setARGtoMEM::mem + asm { lda$feldy$ffjsr$ba8c } + to:setARGtoMEM::@return +setARGtoMEM::@return: scope:[setARGtoMEM] from setARGtoMEM + return + to:@return +@15: scope:[] from @14 + to:@16 +addMEMtoFAC: scope:[addMEMtoFAC] from + (void~) addMEMtoFAC::$0 ← call prepareMEM (byte*) addMEMtoFAC::mem + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC + return + to:@return +@16: scope:[] from @15 + to:@17 +addARGtoFAC: scope:[addARGtoFAC] from + asm { jsr$b86a } + to:addARGtoFAC::@return +addARGtoFAC::@return: scope:[addARGtoFAC] from addARGtoFAC + return + to:@return +@17: scope:[] from @16 + to:@18 +subFACfromMEM: scope:[subFACfromMEM] from + (void~) subFACfromMEM::$0 ← call prepareMEM (byte*) subFACfromMEM::mem + asm { lda$feldy$ffjsr$b850 } + to:subFACfromMEM::@return +subFACfromMEM::@return: scope:[subFACfromMEM] from subFACfromMEM + return + to:@return +@18: scope:[] from @17 + to:@19 +subFACfromARG: scope:[subFACfromARG] from + asm { jsr$b853 } + to:subFACfromARG::@return +subFACfromARG::@return: scope:[subFACfromARG] from subFACfromARG + return + to:@return +@19: scope:[] from @18 + to:@20 +divMEMbyFAC: scope:[divMEMbyFAC] from + (void~) divMEMbyFAC::$0 ← call prepareMEM (byte*) divMEMbyFAC::mem + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC + return + to:@return +@20: scope:[] from @19 + to:@21 +mulFACbyMEM: scope:[mulFACbyMEM] from + (void~) mulFACbyMEM::$0 ← call prepareMEM (byte*) mulFACbyMEM::mem + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM + return + to:@return +@21: scope:[] from @20 + to:@22 +pwrMEMbyFAC: scope:[pwrMEMbyFAC] from + (void~) pwrMEMbyFAC::$0 ← call prepareMEM (byte*) pwrMEMbyFAC::mem + asm { lda$feldy$ffjsr$bf78 } + to:pwrMEMbyFAC::@return +pwrMEMbyFAC::@return: scope:[pwrMEMbyFAC] from pwrMEMbyFAC + return + to:@return +@22: scope:[] from @21 + to:@23 +intFAC: scope:[intFAC] from + asm { jsr$bccc } + to:intFAC::@return +intFAC::@return: scope:[intFAC] from intFAC + return + to:@return +@23: scope:[] from @22 + to:@24 +sinFAC: scope:[sinFAC] from + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@24: scope:[] from @23 + to:@25 +cosFAC: scope:[cosFAC] from + asm { jsr$e264 } + to:cosFAC::@return +cosFAC::@return: scope:[cosFAC] from cosFAC + return + to:@return +@25: scope:[] from @24 + to:@26 +tanFAC: scope:[tanFAC] from + asm { jsr$e2b4 } + to:tanFAC::@return +tanFAC::@return: scope:[tanFAC] from tanFAC + return + to:@return +@26: scope:[] from @25 + to:@27 +atnFAC: scope:[atnFAC] from + asm { jsr$e303 } + to:atnFAC::@return +atnFAC::@return: scope:[atnFAC] from atnFAC + return + to:@return +@27: scope:[] from @26 + to:@28 +sqrFAC: scope:[sqrFAC] from + asm { jsr$bf71 } + to:sqrFAC::@return +sqrFAC::@return: scope:[sqrFAC] from sqrFAC + return + to:@return +@28: scope:[] from @27 + to:@29 +expFAC: scope:[expFAC] from + asm { jsr$bfed } + to:expFAC::@return +expFAC::@return: scope:[expFAC] from expFAC + return + to:@return +@29: scope:[] from @28 + to:@30 +logFAC: scope:[logFAC] from + asm { jsr$b9ea } + to:logFAC::@return +logFAC::@return: scope:[logFAC] from logFAC + return + to:@return +@30: scope:[] from @29 + (byte[]) f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from + (void~) main::$0 ← call setFAC (byte/signed byte/word/signed word) 127 + (void~) main::$1 ← call setMEMtoFAC (byte[]) f_127 + (byte) main::i ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main main::@1 + (word~) main::$2 ← ((word)) (byte) main::i + (void~) main::$3 ← call setFAC (word~) main::$2 + (void~) main::$4 ← call mulFACbyMEM (byte*) f_2pi + (void~) main::$5 ← call setMEMtoFAC (byte[]) f_i + (void~) main::$6 ← call setFAC (byte/signed byte/word/signed word) 25 + (void~) main::$7 ← call divMEMbyFAC (byte[]) f_i + (void~) main::$8 ← call sinFAC + (void~) main::$9 ← call mulFACbyMEM (byte[]) f_127 + (void~) main::$10 ← call addMEMtoFAC (byte[]) f_127 + (word~) main::$11 ← call getFAC + (void~) main::$12 ← call print_word (word~) main::$11 + (void~) main::$13 ← call print_ln + (byte) main::i ← ++ (byte) main::i + (boolean~) main::$14 ← (byte) main::i != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + to:main::@return +main::@return: scope:[main] from main::@2 + return + to:@return +@31: scope:[] from @30 + call main + to:@end +@end: scope:[] from @31 + +Removing unused procedure print_str +Removing unused procedure setARGtoFAC +Removing unused procedure setFACtoARG +Removing unused procedure setFACtoMEM +Removing unused procedure setFACtoPIhalf +Removing unused procedure setFACto2PI +Removing unused procedure setARGtoMEM +Removing unused procedure addARGtoFAC +Removing unused procedure subFACfromMEM +Removing unused procedure subFACfromARG +Removing unused procedure pwrMEMbyFAC +Removing unused procedure intFAC +Removing unused procedure cosFAC +Removing unused procedure tanFAC +Removing unused procedure atnFAC +Removing unused procedure sqrFAC +Removing unused procedure expFAC +Removing unused procedure logFAC +Eliminating unused variable - keeping the call (void~) print_word::$1 +Eliminating unused variable - keeping the call (void~) print_word::$3 +Eliminating unused variable - keeping the call (void~) print_byte::$2 +Eliminating unused variable - keeping the call (void~) print_byte::$5 +Eliminating unused variable - keeping the call (void~) setMEMtoFAC::$0 +Eliminating unused variable - keeping the call (void~) addMEMtoFAC::$0 +Eliminating unused variable - keeping the call (void~) divMEMbyFAC::$0 +Eliminating unused variable - keeping the call (void~) mulFACbyMEM::$0 +Eliminating unused variable - keeping the call (void~) main::$0 +Eliminating unused variable - keeping the call (void~) main::$1 +Eliminating unused variable - keeping the call (void~) main::$3 +Eliminating unused variable - keeping the call (void~) main::$4 +Eliminating unused variable - keeping the call (void~) main::$5 +Eliminating unused variable - keeping the call (void~) main::$6 +Eliminating unused variable - keeping the call (void~) main::$7 +Eliminating unused variable - keeping the call (void~) main::$8 +Eliminating unused variable - keeping the call (void~) main::$9 +Eliminating unused variable - keeping the call (void~) main::$10 +Eliminating unused variable - keeping the call (void~) main::$12 +Eliminating unused variable - keeping the call (void~) main::$13 +Removing empty block @1 +Removing empty block @2 +Removing empty block @4 +Removing empty block @5 +Removing empty block @6 +Removing empty block getFAC::@1 +Removing empty block @7 +Removing empty block @8 +Removing empty block @10 +Removing empty block @11 +Removing empty block @12 +Removing empty block @13 +Removing empty block @14 +Removing empty block @15 +Removing empty block @16 +Removing empty block @17 +Removing empty block @18 +Removing empty block @19 +Removing empty block @20 +Removing empty block @21 +Removing empty block @22 +Removing empty block @23 +Removing empty block @24 +Removing empty block @25 +Removing empty block @26 +Removing empty block @27 +Removing empty block @28 +Removing empty block @29 +Removing empty block main::@2 +CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor ← (byte*) line_cursor + to:@3 +print_ln: scope:[print_ln] from + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*~) print_ln::$0 ← (byte*) line_cursor + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor < (byte*) char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) char_cursor ← (byte*) line_cursor + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from + (byte~) print_word::$0 ← > (word) print_word::w + call print_byte (byte~) print_word::$0 + (byte~) print_word::$2 ← < (word) print_word::w + call print_byte (byte~) print_word::$2 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word + return + to:@return +@3: scope:[] from @begin + (byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from + (byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab *idx (byte~) print_byte::$0 + call print_char (byte~) print_byte::$1 + (byte~) print_byte::$3 ← (byte) print_byte::b & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab *idx (byte~) print_byte::$3 + call print_char (byte~) print_byte::$4 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte + return + to:@return +print_char: scope:[print_char] from + *((byte*) char_cursor) ← (byte) print_char::ch + (byte*) char_cursor ← ++ (byte*) char_cursor + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from + (byte*) setFAC::lo ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w + *((byte*) setFAC::lo) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w + *((byte*) setFAC::hi) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from + (byte*) getFAC::lo ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w ← (word) getFAC::w lo= *((byte*) getFAC::lo) + (word) getFAC::w ← (word) getFAC::w hi= *((byte*) getFAC::hi) + (word) getFAC::return ← (word) getFAC::w + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + (word) getFAC::return ← (word) getFAC::return + return (word) getFAC::return + to:@return +@9: scope:[] from @3 + (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem + *((byte*) memLo) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem + *((byte*) memHi) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from + call prepareMEM (byte*) setMEMtoFAC::mem + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from + call prepareMEM (byte*) addMEMtoFAC::mem + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from + call prepareMEM (byte*) divMEMbyFAC::mem + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from + call prepareMEM (byte*) mulFACbyMEM::mem + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM + return + to:@return +sinFAC: scope:[sinFAC] from + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from + call setFAC (byte/signed byte/word/signed word) 127 + call setMEMtoFAC (byte[]) f_127 + (byte) main::i ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main main::@1 + (word~) main::$2 ← ((word)) (byte) main::i + call setFAC (word~) main::$2 + call mulFACbyMEM (byte*) f_2pi + call setMEMtoFAC (byte[]) f_i + call setFAC (byte/signed byte/word/signed word) 25 + call divMEMbyFAC (byte[]) f_i + call sinFAC + call mulFACbyMEM (byte[]) f_127 + call addMEMtoFAC (byte[]) f_127 + (word~) main::$11 ← call getFAC + call print_word (word~) main::$11 + call print_ln + (byte) main::i ← ++ (byte) main::i + (boolean~) main::$14 ← (byte) main::i != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@1 + return + to:@return +@31: scope:[] from @30 + call main + to:@end +@end: scope:[] from @31 + +PROCEDURE MODIFY VARIABLE ANALYSIS +print_ln modifies line_cursor +print_ln modifies char_cursor +print_word modifies char_cursor +print_byte modifies char_cursor +print_char modifies char_cursor +main modifies char_cursor +main modifies line_cursor + +CONTROL FLOW GRAPH WITH ASSIGNMENT CALL +@begin: scope:[] from + (byte*) line_cursor ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor ← (byte*) line_cursor + to:@3 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*~) print_ln::$0 ← (byte*) line_cursor + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor < (byte*) char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) char_cursor ← (byte*) line_cursor + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) line_cursor ← (byte*) line_cursor + (byte*) char_cursor ← (byte*) char_cursor + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w + (byte) print_byte::b ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte*) char_cursor ← (byte*) char_cursor + (byte~) print_word::$2 ← < (word) print_word::w + (byte) print_byte::b ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + (byte*) char_cursor ← (byte*) char_cursor + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + (byte*) char_cursor ← (byte*) char_cursor + return + to:@return +@3: scope:[] from @begin + (byte[]) hextab ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab *idx (byte~) print_byte::$0 + (byte) print_char::ch ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte*) char_cursor ← (byte*) char_cursor + (byte~) print_byte::$3 ← (byte) print_byte::b & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab *idx (byte~) print_byte::$3 + (byte) print_char::ch ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) char_cursor ← (byte*) char_cursor + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + (byte*) char_cursor ← (byte*) char_cursor + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + *((byte*) char_cursor) ← (byte) print_char::ch + (byte*) char_cursor ← ++ (byte*) char_cursor + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + (byte*) char_cursor ← (byte*) char_cursor + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (byte*) setFAC::lo ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w + *((byte*) setFAC::lo) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w + *((byte*) setFAC::hi) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w ← (word) getFAC::w lo= *((byte*) getFAC::lo) + (word) getFAC::w ← (word) getFAC::w hi= *((byte*) getFAC::hi) + (word) getFAC::return ← (word) getFAC::w + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + (word) getFAC::return ← (word) getFAC::return + return (word) getFAC::return + to:@return +@9: scope:[] from @3 + (byte*) memLo ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem + *((byte*) memLo) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem + *((byte*) memHi) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) prepareMEM::mem ← (byte*) setMEMtoFAC::mem + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) prepareMEM::mem ← (byte*) addMEMtoFAC::mem + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) prepareMEM::mem ← (byte*) divMEMbyFAC::mem + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) prepareMEM::mem ← (byte*) mulFACbyMEM::mem + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) f_i ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (word) setFAC::w ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem ← (byte[]) f_127 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte) main::i ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (word~) main::$2 ← ((word)) (byte) main::i + (word) setFAC::w ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem ← (byte*) f_2pi + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem ← (byte[]) f_i + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (word) setFAC::w ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem ← (byte[]) f_i + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem ← (byte[]) f_127 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem ← (byte[]) f_127 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + (word) getFAC::return ← call getFAC param-assignment + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return + (word) print_word::w ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + (byte*) char_cursor ← (byte*) char_cursor + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte*) line_cursor ← (byte*) line_cursor + (byte*) char_cursor ← (byte*) char_cursor + (byte) main::i ← ++ (byte) main::i + (boolean~) main::$14 ← (byte) main::i != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + (byte*) char_cursor ← (byte*) char_cursor + (byte*) line_cursor ← (byte*) line_cursor + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + (byte*) char_cursor ← (byte*) char_cursor + (byte*) line_cursor ← (byte*) line_cursor + to:@end +@end: scope:[] from @32 + +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor#0 ← (byte*) line_cursor#0 + to:@3 +print_ln: scope:[print_ln] from main::@14 + (byte*) char_cursor#29 ← phi( main::@14/(byte*) char_cursor#11 ) + (byte*) line_cursor#12 ← phi( main::@14/(byte*) line_cursor#13 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#29 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#12 print_ln::@1/(byte*) line_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor#1 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) line_cursor#7 ← phi( print_ln::@1/(byte*) line_cursor#1 ) + (byte*) char_cursor#1 ← (byte*) line_cursor#7 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) char_cursor#16 ← phi( print_ln::@2/(byte*) char_cursor#1 ) + (byte*) line_cursor#8 ← phi( print_ln::@2/(byte*) line_cursor#7 ) + (byte*) line_cursor#2 ← (byte*) line_cursor#8 + (byte*) char_cursor#2 ← (byte*) char_cursor#16 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte[]) hextab#3 ← phi( main::@13/(byte[]) hextab#5 ) + (byte*) char_cursor#30 ← phi( main::@13/(byte*) char_cursor#32 ) + (word) print_word::w#1 ← phi( main::@13/(word) print_word::w#0 ) + (byte~) print_word::$0 ← > (word) print_word::w#1 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte[]) hextab#4 ← phi( print_word/(byte[]) hextab#3 ) + (word) print_word::w#2 ← phi( print_word/(word) print_word::w#1 ) + (byte*) char_cursor#17 ← phi( print_word/(byte*) char_cursor#30 ) + (byte*) char_cursor#3 ← (byte*) char_cursor#17 + (byte~) print_word::$2 ← < (word) print_word::w#2 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + (byte*) char_cursor#18 ← phi( print_word::@1/(byte*) char_cursor#3 ) + (byte*) char_cursor#4 ← (byte*) char_cursor#18 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + (byte*) char_cursor#19 ← phi( print_word::@2/(byte*) char_cursor#4 ) + (byte*) char_cursor#5 ← (byte*) char_cursor#19 + return + to:@return +@3: scope:[] from @begin + (byte*) line_cursor#19 ← phi( @begin/(byte*) line_cursor#0 ) + (byte*) char_cursor#38 ← phi( @begin/(byte*) char_cursor#0 ) + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#30 print_word::@1/(byte*) char_cursor#3 ) + (byte[]) hextab#1 ← phi( print_word/(byte[]) hextab#3 print_word::@1/(byte[]) hextab#4 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#1 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte[]) hextab#2 ← phi( print_byte/(byte[]) hextab#1 ) + (byte) print_byte::b#3 ← phi( print_byte/(byte) print_byte::b#2 ) + (byte*) char_cursor#20 ← phi( print_byte/(byte*) char_cursor#31 ) + (byte*) char_cursor#6 ← (byte*) char_cursor#20 + (byte~) print_byte::$3 ← (byte) print_byte::b#3 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#2 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) char_cursor#21 ← phi( print_byte::@1/(byte*) char_cursor#6 ) + (byte*) char_cursor#7 ← (byte*) char_cursor#21 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + (byte*) char_cursor#22 ← phi( print_byte::@2/(byte*) char_cursor#7 ) + (byte*) char_cursor#8 ← (byte*) char_cursor#22 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#6 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#9 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + (byte*) char_cursor#24 ← phi( print_char/(byte*) char_cursor#9 ) + (byte*) char_cursor#10 ← (byte*) char_cursor#24 + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::w#2 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + (word) getFAC::return#0 ← (word) getFAC::w#2 + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + (word) getFAC::return#3 ← phi( getFAC/(word) getFAC::return#0 ) + (word) getFAC::return#1 ← (word) getFAC::return#3 + return (word) getFAC::return#1 + to:@return +@9: scope:[] from @3 + (byte[]) hextab#22 ← phi( @3/(byte[]) hextab#0 ) + (byte*) line_cursor#17 ← phi( @3/(byte*) line_cursor#19 ) + (byte*) char_cursor#36 ← phi( @3/(byte*) char_cursor#38 ) + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) addMEMtoFAC::mem#1 ← phi( main::@11/(byte*) addMEMtoFAC::mem#0 ) + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#1 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) divMEMbyFAC::mem#1 ← phi( main::@8/(byte*) divMEMbyFAC::mem#0 ) + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#1 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) hextab#21 ← phi( @9/(byte[]) hextab#22 ) + (byte*) line_cursor#16 ← phi( @9/(byte*) line_cursor#17 ) + (byte*) char_cursor#35 ← phi( @9/(byte*) char_cursor#36 ) + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (byte*) line_cursor#30 ← phi( @31/(byte*) line_cursor#14 ) + (byte[]) hextab#19 ← phi( @31/(byte[]) hextab#20 ) + (byte*) char_cursor#48 ← phi( @31/(byte*) char_cursor#33 ) + (byte[]) f_i#10 ← phi( @31/(byte[]) f_i#12 ) + (byte*) f_2pi#7 ← phi( @31/(byte*) f_2pi#9 ) + (byte[]) f_127#4 ← phi( @31/(byte[]) f_127#6 ) + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) line_cursor#29 ← phi( main/(byte*) line_cursor#30 ) + (byte[]) hextab#17 ← phi( main/(byte[]) hextab#19 ) + (byte*) char_cursor#47 ← phi( main/(byte*) char_cursor#48 ) + (byte[]) f_i#8 ← phi( main/(byte[]) f_i#10 ) + (byte*) f_2pi#5 ← phi( main/(byte*) f_2pi#7 ) + (byte[]) f_127#1 ← phi( main/(byte[]) f_127#4 ) + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#1 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte*) line_cursor#28 ← phi( main::@3/(byte*) line_cursor#29 ) + (byte[]) hextab#16 ← phi( main::@3/(byte[]) hextab#17 ) + (byte*) char_cursor#46 ← phi( main::@3/(byte*) char_cursor#47 ) + (byte[]) f_127#13 ← phi( main::@3/(byte[]) f_127#1 ) + (byte[]) f_i#7 ← phi( main::@3/(byte[]) f_i#8 ) + (byte*) f_2pi#4 ← phi( main::@3/(byte*) f_2pi#5 ) + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#27 ← phi( main::@15/(byte*) line_cursor#3 main::@4/(byte*) line_cursor#28 ) + (byte[]) hextab#14 ← phi( main::@15/(byte[]) hextab#15 main::@4/(byte[]) hextab#16 ) + (byte*) char_cursor#45 ← phi( main::@15/(byte*) char_cursor#12 main::@4/(byte*) char_cursor#46 ) + (byte[]) f_127#11 ← phi( main::@15/(byte[]) f_127#12 main::@4/(byte[]) f_127#13 ) + (byte[]) f_i#5 ← phi( main::@15/(byte[]) f_i#6 main::@4/(byte[]) f_i#7 ) + (byte*) f_2pi#2 ← phi( main::@15/(byte*) f_2pi#3 main::@4/(byte*) f_2pi#4 ) + (byte) main::i#2 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#2 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte) main::i#13 ← phi( main::@1/(byte) main::i#2 ) + (byte*) line_cursor#26 ← phi( main::@1/(byte*) line_cursor#27 ) + (byte[]) hextab#13 ← phi( main::@1/(byte[]) hextab#14 ) + (byte*) char_cursor#44 ← phi( main::@1/(byte*) char_cursor#45 ) + (byte[]) f_127#10 ← phi( main::@1/(byte[]) f_127#11 ) + (byte[]) f_i#3 ← phi( main::@1/(byte[]) f_i#5 ) + (byte*) f_2pi#1 ← phi( main::@1/(byte*) f_2pi#2 ) + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) f_2pi#16 ← phi( main::@5/(byte*) f_2pi#1 ) + (byte) main::i#12 ← phi( main::@5/(byte) main::i#13 ) + (byte*) line_cursor#25 ← phi( main::@5/(byte*) line_cursor#26 ) + (byte[]) hextab#12 ← phi( main::@5/(byte[]) hextab#13 ) + (byte*) char_cursor#43 ← phi( main::@5/(byte*) char_cursor#44 ) + (byte[]) f_127#9 ← phi( main::@5/(byte[]) f_127#10 ) + (byte[]) f_i#1 ← phi( main::@5/(byte[]) f_i#3 ) + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#1 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (byte*) f_2pi#15 ← phi( main::@6/(byte*) f_2pi#16 ) + (byte) main::i#11 ← phi( main::@6/(byte) main::i#12 ) + (byte*) line_cursor#24 ← phi( main::@6/(byte*) line_cursor#25 ) + (byte[]) hextab#11 ← phi( main::@6/(byte[]) hextab#12 ) + (byte*) char_cursor#42 ← phi( main::@6/(byte*) char_cursor#43 ) + (byte[]) f_127#8 ← phi( main::@6/(byte[]) f_127#9 ) + (byte[]) f_i#4 ← phi( main::@6/(byte[]) f_i#1 ) + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) f_2pi#14 ← phi( main::@7/(byte*) f_2pi#15 ) + (byte) main::i#10 ← phi( main::@7/(byte) main::i#11 ) + (byte*) line_cursor#23 ← phi( main::@7/(byte*) line_cursor#24 ) + (byte[]) hextab#10 ← phi( main::@7/(byte[]) hextab#11 ) + (byte*) char_cursor#41 ← phi( main::@7/(byte*) char_cursor#42 ) + (byte[]) f_127#7 ← phi( main::@7/(byte[]) f_127#8 ) + (byte[]) f_i#2 ← phi( main::@7/(byte[]) f_i#4 ) + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#2 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + (byte[]) f_i#16 ← phi( main::@8/(byte[]) f_i#2 ) + (byte*) f_2pi#13 ← phi( main::@8/(byte*) f_2pi#14 ) + (byte) main::i#9 ← phi( main::@8/(byte) main::i#10 ) + (byte*) line_cursor#22 ← phi( main::@8/(byte*) line_cursor#23 ) + (byte[]) hextab#9 ← phi( main::@8/(byte[]) hextab#10 ) + (byte*) char_cursor#40 ← phi( main::@8/(byte*) char_cursor#41 ) + (byte[]) f_127#5 ← phi( main::@8/(byte[]) f_127#7 ) + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte[]) f_i#15 ← phi( main::@9/(byte[]) f_i#16 ) + (byte*) f_2pi#12 ← phi( main::@9/(byte*) f_2pi#13 ) + (byte) main::i#8 ← phi( main::@9/(byte) main::i#9 ) + (byte*) line_cursor#21 ← phi( main::@9/(byte*) line_cursor#22 ) + (byte[]) hextab#8 ← phi( main::@9/(byte[]) hextab#9 ) + (byte*) char_cursor#39 ← phi( main::@9/(byte*) char_cursor#40 ) + (byte[]) f_127#2 ← phi( main::@9/(byte[]) f_127#5 ) + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#2 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte[]) f_i#14 ← phi( main::@10/(byte[]) f_i#15 ) + (byte*) f_2pi#11 ← phi( main::@10/(byte*) f_2pi#12 ) + (byte) main::i#7 ← phi( main::@10/(byte) main::i#8 ) + (byte*) line_cursor#20 ← phi( main::@10/(byte*) line_cursor#21 ) + (byte[]) hextab#7 ← phi( main::@10/(byte[]) hextab#8 ) + (byte*) char_cursor#37 ← phi( main::@10/(byte*) char_cursor#39 ) + (byte[]) f_127#3 ← phi( main::@10/(byte[]) f_127#2 ) + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#3 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + (byte[]) f_127#16 ← phi( main::@11/(byte[]) f_127#3 ) + (byte[]) f_i#13 ← phi( main::@11/(byte[]) f_i#14 ) + (byte*) f_2pi#10 ← phi( main::@11/(byte*) f_2pi#11 ) + (byte) main::i#6 ← phi( main::@11/(byte) main::i#7 ) + (byte*) line_cursor#18 ← phi( main::@11/(byte*) line_cursor#20 ) + (byte[]) hextab#6 ← phi( main::@11/(byte[]) hextab#7 ) + (byte*) char_cursor#34 ← phi( main::@11/(byte*) char_cursor#37 ) + (word) getFAC::return#2 ← call getFAC param-assignment + to:main::@13 +main::@13: scope:[main] from main::@12 + (byte[]) f_127#15 ← phi( main::@12/(byte[]) f_127#16 ) + (byte[]) f_i#11 ← phi( main::@12/(byte[]) f_i#13 ) + (byte*) f_2pi#8 ← phi( main::@12/(byte*) f_2pi#10 ) + (byte) main::i#5 ← phi( main::@12/(byte) main::i#6 ) + (byte*) line_cursor#15 ← phi( main::@12/(byte*) line_cursor#18 ) + (byte[]) hextab#5 ← phi( main::@12/(byte[]) hextab#6 ) + (byte*) char_cursor#32 ← phi( main::@12/(byte*) char_cursor#34 ) + (word) getFAC::return#4 ← phi( main::@12/(word) getFAC::return#2 ) + (word~) main::$11 ← (word) getFAC::return#4 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + (byte[]) hextab#18 ← phi( main::@13/(byte[]) hextab#5 ) + (byte[]) f_127#14 ← phi( main::@13/(byte[]) f_127#15 ) + (byte[]) f_i#9 ← phi( main::@13/(byte[]) f_i#11 ) + (byte*) f_2pi#6 ← phi( main::@13/(byte*) f_2pi#8 ) + (byte) main::i#4 ← phi( main::@13/(byte) main::i#5 ) + (byte*) line_cursor#13 ← phi( main::@13/(byte*) line_cursor#15 ) + (byte*) char_cursor#25 ← phi( main::@13/(byte*) char_cursor#32 ) + (byte*) char_cursor#11 ← (byte*) char_cursor#25 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte[]) hextab#15 ← phi( main::@14/(byte[]) hextab#18 ) + (byte[]) f_127#12 ← phi( main::@14/(byte[]) f_127#14 ) + (byte[]) f_i#6 ← phi( main::@14/(byte[]) f_i#9 ) + (byte*) f_2pi#3 ← phi( main::@14/(byte*) f_2pi#6 ) + (byte) main::i#3 ← phi( main::@14/(byte) main::i#4 ) + (byte*) char_cursor#26 ← phi( main::@14/(byte*) char_cursor#11 ) + (byte*) line_cursor#9 ← phi( main::@14/(byte*) line_cursor#13 ) + (byte*) line_cursor#3 ← (byte*) line_cursor#9 + (byte*) char_cursor#12 ← (byte*) char_cursor#26 + (byte) main::i#1 ← ++ (byte) main::i#3 + (boolean~) main::$14 ← (byte) main::i#1 != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + (byte*) line_cursor#10 ← phi( main::@15/(byte*) line_cursor#3 ) + (byte*) char_cursor#27 ← phi( main::@15/(byte*) char_cursor#12 ) + (byte*) char_cursor#13 ← (byte*) char_cursor#27 + (byte*) line_cursor#4 ← (byte*) line_cursor#10 + return + to:@return +@31: scope:[] from @30 + (byte[]) hextab#20 ← phi( @30/(byte[]) hextab#21 ) + (byte[]) f_i#12 ← phi( @30/(byte[]) f_i#0 ) + (byte*) f_2pi#9 ← phi( @30/(byte*) f_2pi#0 ) + (byte[]) f_127#6 ← phi( @30/(byte[]) f_127#0 ) + (byte*) line_cursor#14 ← phi( @30/(byte*) line_cursor#16 ) + (byte*) char_cursor#33 ← phi( @30/(byte*) char_cursor#35 ) + call main param-assignment + to:@32 +@32: scope:[] from @31 + (byte*) line_cursor#11 ← phi( @31/(byte*) line_cursor#14 ) + (byte*) char_cursor#28 ← phi( @31/(byte*) char_cursor#33 ) + (byte*) char_cursor#14 ← (byte*) char_cursor#28 + (byte*) line_cursor#5 ← (byte*) line_cursor#11 + to:@end +@end: scope:[] from @32 + +CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor#0 ← (byte*) line_cursor#0 + to:@3 +print_ln: scope:[print_ln] from main::@14 + (byte*) char_cursor#29 ← phi( main::@14/(byte*) char_cursor#11 ) + (byte*) line_cursor#12 ← phi( main::@14/(byte*) line_cursor#13 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#29 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#12 print_ln::@1/(byte*) line_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) line_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) line_cursor#1 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) line_cursor#7 ← phi( print_ln::@1/(byte*) line_cursor#1 ) + (byte*) char_cursor#1 ← (byte*) line_cursor#7 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) char_cursor#16 ← phi( print_ln::@2/(byte*) char_cursor#1 ) + (byte*) line_cursor#8 ← phi( print_ln::@2/(byte*) line_cursor#7 ) + (byte*) line_cursor#2 ← (byte*) line_cursor#8 + (byte*) char_cursor#2 ← (byte*) char_cursor#16 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte[]) hextab#3 ← phi( main::@13/(byte[]) hextab#5 ) + (byte*) char_cursor#30 ← phi( main::@13/(byte*) char_cursor#32 ) + (word) print_word::w#1 ← phi( main::@13/(word) print_word::w#0 ) + (byte~) print_word::$0 ← > (word) print_word::w#1 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte[]) hextab#4 ← phi( print_word/(byte[]) hextab#3 ) + (word) print_word::w#2 ← phi( print_word/(word) print_word::w#1 ) + (byte*) char_cursor#17 ← phi( print_word/(byte*) char_cursor#8 ) + (byte*) char_cursor#3 ← (byte*) char_cursor#17 + (byte~) print_word::$2 ← < (word) print_word::w#2 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + (byte*) char_cursor#18 ← phi( print_word::@1/(byte*) char_cursor#8 ) + (byte*) char_cursor#4 ← (byte*) char_cursor#18 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + (byte*) char_cursor#19 ← phi( print_word::@2/(byte*) char_cursor#4 ) + (byte*) char_cursor#5 ← (byte*) char_cursor#19 + return + to:@return +@3: scope:[] from @begin + (byte*) line_cursor#19 ← phi( @begin/(byte*) line_cursor#0 ) + (byte*) char_cursor#38 ← phi( @begin/(byte*) char_cursor#0 ) + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#30 print_word::@1/(byte*) char_cursor#3 ) + (byte[]) hextab#1 ← phi( print_word/(byte[]) hextab#3 print_word::@1/(byte[]) hextab#4 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#1 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte[]) hextab#2 ← phi( print_byte/(byte[]) hextab#1 ) + (byte) print_byte::b#3 ← phi( print_byte/(byte) print_byte::b#2 ) + (byte*) char_cursor#20 ← phi( print_byte/(byte*) char_cursor#10 ) + (byte*) char_cursor#6 ← (byte*) char_cursor#20 + (byte~) print_byte::$3 ← (byte) print_byte::b#3 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#2 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) char_cursor#21 ← phi( print_byte::@1/(byte*) char_cursor#10 ) + (byte*) char_cursor#7 ← (byte*) char_cursor#21 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + (byte*) char_cursor#22 ← phi( print_byte::@2/(byte*) char_cursor#7 ) + (byte*) char_cursor#8 ← (byte*) char_cursor#22 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#6 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#9 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + (byte*) char_cursor#24 ← phi( print_char/(byte*) char_cursor#9 ) + (byte*) char_cursor#10 ← (byte*) char_cursor#24 + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::w#2 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + (word) getFAC::return#0 ← (word) getFAC::w#2 + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + (word) getFAC::return#3 ← phi( getFAC/(word) getFAC::return#0 ) + (word) getFAC::return#1 ← (word) getFAC::return#3 + return + to:@return +@9: scope:[] from @3 + (byte[]) hextab#22 ← phi( @3/(byte[]) hextab#0 ) + (byte*) line_cursor#17 ← phi( @3/(byte*) line_cursor#19 ) + (byte*) char_cursor#36 ← phi( @3/(byte*) char_cursor#38 ) + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) addMEMtoFAC::mem#1 ← phi( main::@11/(byte*) addMEMtoFAC::mem#0 ) + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#1 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) divMEMbyFAC::mem#1 ← phi( main::@8/(byte*) divMEMbyFAC::mem#0 ) + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#1 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) hextab#21 ← phi( @9/(byte[]) hextab#22 ) + (byte*) line_cursor#16 ← phi( @9/(byte*) line_cursor#17 ) + (byte*) char_cursor#35 ← phi( @9/(byte*) char_cursor#36 ) + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (byte*) line_cursor#30 ← phi( @31/(byte*) line_cursor#14 ) + (byte[]) hextab#19 ← phi( @31/(byte[]) hextab#20 ) + (byte*) char_cursor#48 ← phi( @31/(byte*) char_cursor#33 ) + (byte[]) f_i#10 ← phi( @31/(byte[]) f_i#12 ) + (byte*) f_2pi#7 ← phi( @31/(byte*) f_2pi#9 ) + (byte[]) f_127#4 ← phi( @31/(byte[]) f_127#6 ) + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) line_cursor#29 ← phi( main/(byte*) line_cursor#30 ) + (byte[]) hextab#17 ← phi( main/(byte[]) hextab#19 ) + (byte*) char_cursor#47 ← phi( main/(byte*) char_cursor#48 ) + (byte[]) f_i#8 ← phi( main/(byte[]) f_i#10 ) + (byte*) f_2pi#5 ← phi( main/(byte*) f_2pi#7 ) + (byte[]) f_127#1 ← phi( main/(byte[]) f_127#4 ) + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#1 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte*) line_cursor#28 ← phi( main::@3/(byte*) line_cursor#29 ) + (byte[]) hextab#16 ← phi( main::@3/(byte[]) hextab#17 ) + (byte*) char_cursor#46 ← phi( main::@3/(byte*) char_cursor#47 ) + (byte[]) f_127#13 ← phi( main::@3/(byte[]) f_127#1 ) + (byte[]) f_i#7 ← phi( main::@3/(byte[]) f_i#8 ) + (byte*) f_2pi#4 ← phi( main::@3/(byte*) f_2pi#5 ) + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#27 ← phi( main::@15/(byte*) line_cursor#3 main::@4/(byte*) line_cursor#28 ) + (byte[]) hextab#14 ← phi( main::@15/(byte[]) hextab#15 main::@4/(byte[]) hextab#16 ) + (byte*) char_cursor#45 ← phi( main::@15/(byte*) char_cursor#12 main::@4/(byte*) char_cursor#46 ) + (byte[]) f_127#11 ← phi( main::@15/(byte[]) f_127#12 main::@4/(byte[]) f_127#13 ) + (byte[]) f_i#5 ← phi( main::@15/(byte[]) f_i#6 main::@4/(byte[]) f_i#7 ) + (byte*) f_2pi#2 ← phi( main::@15/(byte*) f_2pi#3 main::@4/(byte*) f_2pi#4 ) + (byte) main::i#2 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#2 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte) main::i#13 ← phi( main::@1/(byte) main::i#2 ) + (byte*) line_cursor#26 ← phi( main::@1/(byte*) line_cursor#27 ) + (byte[]) hextab#13 ← phi( main::@1/(byte[]) hextab#14 ) + (byte*) char_cursor#44 ← phi( main::@1/(byte*) char_cursor#45 ) + (byte[]) f_127#10 ← phi( main::@1/(byte[]) f_127#11 ) + (byte[]) f_i#3 ← phi( main::@1/(byte[]) f_i#5 ) + (byte*) f_2pi#1 ← phi( main::@1/(byte*) f_2pi#2 ) + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) f_2pi#16 ← phi( main::@5/(byte*) f_2pi#1 ) + (byte) main::i#12 ← phi( main::@5/(byte) main::i#13 ) + (byte*) line_cursor#25 ← phi( main::@5/(byte*) line_cursor#26 ) + (byte[]) hextab#12 ← phi( main::@5/(byte[]) hextab#13 ) + (byte*) char_cursor#43 ← phi( main::@5/(byte*) char_cursor#44 ) + (byte[]) f_127#9 ← phi( main::@5/(byte[]) f_127#10 ) + (byte[]) f_i#1 ← phi( main::@5/(byte[]) f_i#3 ) + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#1 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (byte*) f_2pi#15 ← phi( main::@6/(byte*) f_2pi#16 ) + (byte) main::i#11 ← phi( main::@6/(byte) main::i#12 ) + (byte*) line_cursor#24 ← phi( main::@6/(byte*) line_cursor#25 ) + (byte[]) hextab#11 ← phi( main::@6/(byte[]) hextab#12 ) + (byte*) char_cursor#42 ← phi( main::@6/(byte*) char_cursor#43 ) + (byte[]) f_127#8 ← phi( main::@6/(byte[]) f_127#9 ) + (byte[]) f_i#4 ← phi( main::@6/(byte[]) f_i#1 ) + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) f_2pi#14 ← phi( main::@7/(byte*) f_2pi#15 ) + (byte) main::i#10 ← phi( main::@7/(byte) main::i#11 ) + (byte*) line_cursor#23 ← phi( main::@7/(byte*) line_cursor#24 ) + (byte[]) hextab#10 ← phi( main::@7/(byte[]) hextab#11 ) + (byte*) char_cursor#41 ← phi( main::@7/(byte*) char_cursor#42 ) + (byte[]) f_127#7 ← phi( main::@7/(byte[]) f_127#8 ) + (byte[]) f_i#2 ← phi( main::@7/(byte[]) f_i#4 ) + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#2 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + (byte[]) f_i#16 ← phi( main::@8/(byte[]) f_i#2 ) + (byte*) f_2pi#13 ← phi( main::@8/(byte*) f_2pi#14 ) + (byte) main::i#9 ← phi( main::@8/(byte) main::i#10 ) + (byte*) line_cursor#22 ← phi( main::@8/(byte*) line_cursor#23 ) + (byte[]) hextab#9 ← phi( main::@8/(byte[]) hextab#10 ) + (byte*) char_cursor#40 ← phi( main::@8/(byte*) char_cursor#41 ) + (byte[]) f_127#5 ← phi( main::@8/(byte[]) f_127#7 ) + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte[]) f_i#15 ← phi( main::@9/(byte[]) f_i#16 ) + (byte*) f_2pi#12 ← phi( main::@9/(byte*) f_2pi#13 ) + (byte) main::i#8 ← phi( main::@9/(byte) main::i#9 ) + (byte*) line_cursor#21 ← phi( main::@9/(byte*) line_cursor#22 ) + (byte[]) hextab#8 ← phi( main::@9/(byte[]) hextab#9 ) + (byte*) char_cursor#39 ← phi( main::@9/(byte*) char_cursor#40 ) + (byte[]) f_127#2 ← phi( main::@9/(byte[]) f_127#5 ) + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#2 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte[]) f_i#14 ← phi( main::@10/(byte[]) f_i#15 ) + (byte*) f_2pi#11 ← phi( main::@10/(byte*) f_2pi#12 ) + (byte) main::i#7 ← phi( main::@10/(byte) main::i#8 ) + (byte*) line_cursor#20 ← phi( main::@10/(byte*) line_cursor#21 ) + (byte[]) hextab#7 ← phi( main::@10/(byte[]) hextab#8 ) + (byte*) char_cursor#37 ← phi( main::@10/(byte*) char_cursor#39 ) + (byte[]) f_127#3 ← phi( main::@10/(byte[]) f_127#2 ) + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#3 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + (byte[]) f_127#16 ← phi( main::@11/(byte[]) f_127#3 ) + (byte[]) f_i#13 ← phi( main::@11/(byte[]) f_i#14 ) + (byte*) f_2pi#10 ← phi( main::@11/(byte*) f_2pi#11 ) + (byte) main::i#6 ← phi( main::@11/(byte) main::i#7 ) + (byte*) line_cursor#18 ← phi( main::@11/(byte*) line_cursor#20 ) + (byte[]) hextab#6 ← phi( main::@11/(byte[]) hextab#7 ) + (byte*) char_cursor#34 ← phi( main::@11/(byte*) char_cursor#37 ) + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#1 + to:main::@13 +main::@13: scope:[main] from main::@12 + (byte[]) f_127#15 ← phi( main::@12/(byte[]) f_127#16 ) + (byte[]) f_i#11 ← phi( main::@12/(byte[]) f_i#13 ) + (byte*) f_2pi#8 ← phi( main::@12/(byte*) f_2pi#10 ) + (byte) main::i#5 ← phi( main::@12/(byte) main::i#6 ) + (byte*) line_cursor#15 ← phi( main::@12/(byte*) line_cursor#18 ) + (byte[]) hextab#5 ← phi( main::@12/(byte[]) hextab#6 ) + (byte*) char_cursor#32 ← phi( main::@12/(byte*) char_cursor#34 ) + (word) getFAC::return#4 ← phi( main::@12/(word) getFAC::return#2 ) + (word~) main::$11 ← (word) getFAC::return#4 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + (byte[]) hextab#18 ← phi( main::@13/(byte[]) hextab#5 ) + (byte[]) f_127#14 ← phi( main::@13/(byte[]) f_127#15 ) + (byte[]) f_i#9 ← phi( main::@13/(byte[]) f_i#11 ) + (byte*) f_2pi#6 ← phi( main::@13/(byte*) f_2pi#8 ) + (byte) main::i#4 ← phi( main::@13/(byte) main::i#5 ) + (byte*) line_cursor#13 ← phi( main::@13/(byte*) line_cursor#15 ) + (byte*) char_cursor#25 ← phi( main::@13/(byte*) char_cursor#5 ) + (byte*) char_cursor#11 ← (byte*) char_cursor#25 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte[]) hextab#15 ← phi( main::@14/(byte[]) hextab#18 ) + (byte[]) f_127#12 ← phi( main::@14/(byte[]) f_127#14 ) + (byte[]) f_i#6 ← phi( main::@14/(byte[]) f_i#9 ) + (byte*) f_2pi#3 ← phi( main::@14/(byte*) f_2pi#6 ) + (byte) main::i#3 ← phi( main::@14/(byte) main::i#4 ) + (byte*) char_cursor#26 ← phi( main::@14/(byte*) char_cursor#2 ) + (byte*) line_cursor#9 ← phi( main::@14/(byte*) line_cursor#2 ) + (byte*) line_cursor#3 ← (byte*) line_cursor#9 + (byte*) char_cursor#12 ← (byte*) char_cursor#26 + (byte) main::i#1 ← ++ (byte) main::i#3 + (boolean~) main::$14 ← (byte) main::i#1 != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + (byte*) line_cursor#10 ← phi( main::@15/(byte*) line_cursor#3 ) + (byte*) char_cursor#27 ← phi( main::@15/(byte*) char_cursor#12 ) + (byte*) char_cursor#13 ← (byte*) char_cursor#27 + (byte*) line_cursor#4 ← (byte*) line_cursor#10 + return + to:@return +@31: scope:[] from @30 + (byte[]) hextab#20 ← phi( @30/(byte[]) hextab#21 ) + (byte[]) f_i#12 ← phi( @30/(byte[]) f_i#0 ) + (byte*) f_2pi#9 ← phi( @30/(byte*) f_2pi#0 ) + (byte[]) f_127#6 ← phi( @30/(byte[]) f_127#0 ) + (byte*) line_cursor#14 ← phi( @30/(byte*) line_cursor#16 ) + (byte*) char_cursor#33 ← phi( @30/(byte*) char_cursor#35 ) + call main param-assignment + to:@32 +@32: scope:[] from @31 + (byte*) line_cursor#11 ← phi( @31/(byte*) line_cursor#4 ) + (byte*) char_cursor#28 ← phi( @31/(byte*) char_cursor#13 ) + (byte*) char_cursor#14 ← (byte*) char_cursor#28 + (byte*) line_cursor#5 ← (byte*) line_cursor#11 + to:@end +@end: scope:[] from @32 + +INITIAL SSA SYMBOL TABLE +(label) @3 +(label) @30 +(label) @31 +(label) @32 +(label) @9 +(label) @begin +(label) @end +(void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) +(label) addMEMtoFAC::@1 +(label) addMEMtoFAC::@return +(byte*) addMEMtoFAC::mem +(byte*) addMEMtoFAC::mem#0 +(byte*) addMEMtoFAC::mem#1 +(byte*) char_cursor +(byte*) char_cursor#0 +(byte*) char_cursor#1 +(byte*) char_cursor#10 +(byte*) char_cursor#11 +(byte*) char_cursor#12 +(byte*) char_cursor#13 +(byte*) char_cursor#14 +(byte*) char_cursor#15 +(byte*) char_cursor#16 +(byte*) char_cursor#17 +(byte*) char_cursor#18 +(byte*) char_cursor#19 +(byte*) char_cursor#2 +(byte*) char_cursor#20 +(byte*) char_cursor#21 +(byte*) char_cursor#22 +(byte*) char_cursor#23 +(byte*) char_cursor#24 +(byte*) char_cursor#25 +(byte*) char_cursor#26 +(byte*) char_cursor#27 +(byte*) char_cursor#28 +(byte*) char_cursor#29 +(byte*) char_cursor#3 +(byte*) char_cursor#30 +(byte*) char_cursor#31 +(byte*) char_cursor#32 +(byte*) char_cursor#33 +(byte*) char_cursor#34 +(byte*) char_cursor#35 +(byte*) char_cursor#36 +(byte*) char_cursor#37 +(byte*) char_cursor#38 +(byte*) char_cursor#39 +(byte*) char_cursor#4 +(byte*) char_cursor#40 +(byte*) char_cursor#41 +(byte*) char_cursor#42 +(byte*) char_cursor#43 +(byte*) char_cursor#44 +(byte*) char_cursor#45 +(byte*) char_cursor#46 +(byte*) char_cursor#47 +(byte*) char_cursor#48 +(byte*) char_cursor#5 +(byte*) char_cursor#6 +(byte*) char_cursor#7 +(byte*) char_cursor#8 +(byte*) char_cursor#9 +(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) +(label) divMEMbyFAC::@1 +(label) divMEMbyFAC::@return +(byte*) divMEMbyFAC::mem +(byte*) divMEMbyFAC::mem#0 +(byte*) divMEMbyFAC::mem#1 +(byte[]) f_127 +(byte[]) f_127#0 +(byte[]) f_127#1 +(byte[]) f_127#10 +(byte[]) f_127#11 +(byte[]) f_127#12 +(byte[]) f_127#13 +(byte[]) f_127#14 +(byte[]) f_127#15 +(byte[]) f_127#16 +(byte[]) f_127#2 +(byte[]) f_127#3 +(byte[]) f_127#4 +(byte[]) f_127#5 +(byte[]) f_127#6 +(byte[]) f_127#7 +(byte[]) f_127#8 +(byte[]) f_127#9 +(byte*) f_2pi +(byte*) f_2pi#0 +(byte*) f_2pi#1 +(byte*) f_2pi#10 +(byte*) f_2pi#11 +(byte*) f_2pi#12 +(byte*) f_2pi#13 +(byte*) f_2pi#14 +(byte*) f_2pi#15 +(byte*) f_2pi#16 +(byte*) f_2pi#2 +(byte*) f_2pi#3 +(byte*) f_2pi#4 +(byte*) f_2pi#5 +(byte*) f_2pi#6 +(byte*) f_2pi#7 +(byte*) f_2pi#8 +(byte*) f_2pi#9 +(byte[]) f_i +(byte[]) f_i#0 +(byte[]) f_i#1 +(byte[]) f_i#10 +(byte[]) f_i#11 +(byte[]) f_i#12 +(byte[]) f_i#13 +(byte[]) f_i#14 +(byte[]) f_i#15 +(byte[]) f_i#16 +(byte[]) f_i#2 +(byte[]) f_i#3 +(byte[]) f_i#4 +(byte[]) f_i#5 +(byte[]) f_i#6 +(byte[]) f_i#7 +(byte[]) f_i#8 +(byte[]) f_i#9 +(word()) getFAC() +(label) getFAC::@return +(byte*) getFAC::hi +(byte*) getFAC::hi#0 +(byte*) getFAC::lo +(byte*) getFAC::lo#0 +(word) getFAC::return +(word) getFAC::return#0 +(word) getFAC::return#1 +(word) getFAC::return#2 +(word) getFAC::return#3 +(word) getFAC::return#4 +(word) getFAC::w +(word) getFAC::w#0 +(word) getFAC::w#1 +(word) getFAC::w#2 +(byte[]) hextab +(byte[]) hextab#0 +(byte[]) hextab#1 +(byte[]) hextab#10 +(byte[]) hextab#11 +(byte[]) hextab#12 +(byte[]) hextab#13 +(byte[]) hextab#14 +(byte[]) hextab#15 +(byte[]) hextab#16 +(byte[]) hextab#17 +(byte[]) hextab#18 +(byte[]) hextab#19 +(byte[]) hextab#2 +(byte[]) hextab#20 +(byte[]) hextab#21 +(byte[]) hextab#22 +(byte[]) hextab#3 +(byte[]) hextab#4 +(byte[]) hextab#5 +(byte[]) hextab#6 +(byte[]) hextab#7 +(byte[]) hextab#8 +(byte[]) hextab#9 +(byte*) line_cursor +(byte*) line_cursor#0 +(byte*) line_cursor#1 +(byte*) line_cursor#10 +(byte*) line_cursor#11 +(byte*) line_cursor#12 +(byte*) line_cursor#13 +(byte*) line_cursor#14 +(byte*) line_cursor#15 +(byte*) line_cursor#16 +(byte*) line_cursor#17 +(byte*) line_cursor#18 +(byte*) line_cursor#19 +(byte*) line_cursor#2 +(byte*) line_cursor#20 +(byte*) line_cursor#21 +(byte*) line_cursor#22 +(byte*) line_cursor#23 +(byte*) line_cursor#24 +(byte*) line_cursor#25 +(byte*) line_cursor#26 +(byte*) line_cursor#27 +(byte*) line_cursor#28 +(byte*) line_cursor#29 +(byte*) line_cursor#3 +(byte*) line_cursor#30 +(byte*) line_cursor#4 +(byte*) line_cursor#5 +(byte*) line_cursor#6 +(byte*) line_cursor#7 +(byte*) line_cursor#8 +(byte*) line_cursor#9 +(void()) main() +(word~) main::$11 +(boolean~) main::$14 +(word~) main::$2 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@14 +(label) main::@15 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(label) main::@return +(byte) main::i +(byte) main::i#0 +(byte) main::i#1 +(byte) main::i#10 +(byte) main::i#11 +(byte) main::i#12 +(byte) main::i#13 +(byte) main::i#2 +(byte) main::i#3 +(byte) main::i#4 +(byte) main::i#5 +(byte) main::i#6 +(byte) main::i#7 +(byte) main::i#8 +(byte) main::i#9 +(byte*) memHi +(byte*) memHi#0 +(byte*) memLo +(byte*) memLo#0 +(void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) +(label) mulFACbyMEM::@1 +(label) mulFACbyMEM::@return +(byte*) mulFACbyMEM::mem +(byte*) mulFACbyMEM::mem#0 +(byte*) mulFACbyMEM::mem#1 +(byte*) mulFACbyMEM::mem#2 +(void()) prepareMEM((byte*) prepareMEM::mem) +(byte~) prepareMEM::$0 +(byte~) prepareMEM::$1 +(label) prepareMEM::@return +(byte*) prepareMEM::mem +(byte*) prepareMEM::mem#0 +(byte*) prepareMEM::mem#1 +(byte*) prepareMEM::mem#2 +(byte*) prepareMEM::mem#3 +(byte*) prepareMEM::mem#4 +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 +(byte~) print_byte::$1 +(byte~) print_byte::$3 +(byte~) print_byte::$4 +(label) print_byte::@1 +(label) print_byte::@2 +(label) print_byte::@return +(byte) print_byte::b +(byte) print_byte::b#0 +(byte) print_byte::b#1 +(byte) print_byte::b#2 +(byte) print_byte::b#3 +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(byte) print_char::ch#0 +(byte) print_char::ch#1 +(byte) print_char::ch#2 +(void()) print_ln() +(byte*~) print_ln::$0 +(boolean~) print_ln::$1 +(label) print_ln::@1 +(label) print_ln::@2 +(label) print_ln::@return +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 +(byte~) print_word::$2 +(label) print_word::@1 +(label) print_word::@2 +(label) print_word::@return +(word) print_word::w +(word) print_word::w#0 +(word) print_word::w#1 +(word) print_word::w#2 +(void()) setFAC((word) setFAC::w) +(byte~) setFAC::$0 +(byte~) setFAC::$1 +(label) setFAC::@return +(byte*) setFAC::hi +(byte*) setFAC::hi#0 +(byte*) setFAC::lo +(byte*) setFAC::lo#0 +(word) setFAC::w +(word) setFAC::w#0 +(word) setFAC::w#1 +(word) setFAC::w#2 +(word) setFAC::w#3 +(void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) +(label) setMEMtoFAC::@1 +(label) setMEMtoFAC::@return +(byte*) setMEMtoFAC::mem +(byte*) setMEMtoFAC::mem#0 +(byte*) setMEMtoFAC::mem#1 +(byte*) setMEMtoFAC::mem#2 +(void()) sinFAC() +(label) sinFAC::@return + +Not aliassing across scopes: line_cursor#12 line_cursor#13 +Not aliassing across scopes: char_cursor#29 char_cursor#11 +Not aliassing across scopes: line_cursor#1 print_ln::$0 +Not aliassing across scopes: print_word::w#1 print_word::w#0 +Not aliassing across scopes: char_cursor#30 char_cursor#32 +Not aliassing across scopes: hextab#3 hextab#5 +Not aliassing across scopes: print_byte::b#0 print_word::$0 +Not aliassing across scopes: char_cursor#17 char_cursor#8 +Not aliassing across scopes: print_byte::b#1 print_word::$2 +Not aliassing across scopes: char_cursor#18 char_cursor#8 +Not aliassing across scopes: print_byte::b#2 print_byte::b#0 +Not aliassing across scopes: hextab#1 hextab#3 +Not aliassing across scopes: char_cursor#31 char_cursor#30 +Not aliassing across scopes: print_char::ch#0 print_byte::$1 +Not aliassing across scopes: char_cursor#20 char_cursor#10 +Not aliassing across scopes: print_char::ch#1 print_byte::$4 +Not aliassing across scopes: char_cursor#21 char_cursor#10 +Not aliassing across scopes: print_char::ch#2 print_char::ch#0 +Not aliassing across scopes: char_cursor#23 char_cursor#31 +Not aliassing across scopes: setFAC::w#3 setFAC::w#0 +Not aliassing across scopes: prepareMEM::mem#4 prepareMEM::mem#1 +Not aliassing across scopes: setMEMtoFAC::mem#2 setMEMtoFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#0 setMEMtoFAC::mem#2 +Not aliassing across scopes: addMEMtoFAC::mem#1 addMEMtoFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#1 addMEMtoFAC::mem#1 +Not aliassing across scopes: divMEMbyFAC::mem#1 divMEMbyFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#2 divMEMbyFAC::mem#1 +Not aliassing across scopes: mulFACbyMEM::mem#2 mulFACbyMEM::mem#1 +Not aliassing across scopes: prepareMEM::mem#3 mulFACbyMEM::mem#2 +Not aliassing across scopes: f_127#4 f_127#6 +Not aliassing across scopes: f_2pi#7 f_2pi#9 +Not aliassing across scopes: f_i#10 f_i#12 +Not aliassing across scopes: char_cursor#48 char_cursor#33 +Not aliassing across scopes: hextab#19 hextab#20 +Not aliassing across scopes: line_cursor#30 line_cursor#14 +Not aliassing across scopes: setMEMtoFAC::mem#0 f_127#1 +Not aliassing across scopes: setFAC::w#1 main::$2 +Not aliassing across scopes: mulFACbyMEM::mem#0 f_2pi#1 +Not aliassing across scopes: setMEMtoFAC::mem#1 f_i#1 +Not aliassing across scopes: divMEMbyFAC::mem#0 f_i#2 +Not aliassing across scopes: mulFACbyMEM::mem#1 f_127#2 +Not aliassing across scopes: addMEMtoFAC::mem#0 f_127#3 +Not aliassing across scopes: getFAC::return#2 getFAC::return#1 +Not aliassing across scopes: main::$11 getFAC::return#4 +Not aliassing across scopes: print_word::w#0 main::$11 +Not aliassing across scopes: char_cursor#25 char_cursor#5 +Not aliassing across scopes: line_cursor#9 line_cursor#2 +Not aliassing across scopes: char_cursor#26 char_cursor#2 +Not aliassing across scopes: char_cursor#28 char_cursor#13 +Not aliassing across scopes: line_cursor#11 line_cursor#4 +Alias candidate removed (byte*) line_cursor#0 +Alias candidate removed (byte*) line_cursor#19 +Alias candidate removed (byte*) line_cursor#17 +Alias candidate removed (byte*) line_cursor#16 +Alias candidate removed (byte*) char_cursor#1 +Alias (byte*) char_cursor#0 = (byte*) char_cursor#38 (byte*) char_cursor#36 (byte*) char_cursor#35 (byte*) char_cursor#33 (byte*) line_cursor#14 +Alias (byte*) char_cursor#16 = (byte*) line_cursor#7 (byte*) line_cursor#1 (byte*) line_cursor#8 (byte*) line_cursor#2 (byte*) char_cursor#2 +Alias (word) print_word::w#1 = (word) print_word::w#2 +Alias (byte[]) hextab#3 = (byte[]) hextab#4 +Alias (byte*) char_cursor#17 = (byte*) char_cursor#3 +Alias (byte*) char_cursor#18 = (byte*) char_cursor#4 (byte*) char_cursor#19 (byte*) char_cursor#5 +Alias (byte) print_byte::b#2 = (byte) print_byte::b#3 +Alias (byte[]) hextab#1 = (byte[]) hextab#2 +Alias (byte*) char_cursor#20 = (byte*) char_cursor#6 +Alias (byte*) char_cursor#21 = (byte*) char_cursor#7 (byte*) char_cursor#22 (byte*) char_cursor#8 +Alias (byte*) char_cursor#10 = (byte*) char_cursor#24 (byte*) char_cursor#9 +Alias (word) getFAC::return#0 = (word) getFAC::w#2 (word) getFAC::return#3 (word) getFAC::return#1 +Alias (byte[]) hextab#0 = (byte[]) hextab#22 (byte[]) hextab#21 (byte[]) hextab#20 +Alias (byte[]) f_127#1 = (byte[]) f_127#4 (byte[]) f_127#13 +Alias (byte*) f_2pi#4 = (byte*) f_2pi#5 (byte*) f_2pi#7 +Alias (byte[]) f_i#10 = (byte[]) f_i#8 (byte[]) f_i#7 +Alias (byte*) char_cursor#46 = (byte*) char_cursor#47 (byte*) char_cursor#48 +Alias (byte[]) hextab#16 = (byte[]) hextab#17 (byte[]) hextab#19 +Alias (byte*) line_cursor#28 = (byte*) line_cursor#29 (byte*) line_cursor#30 +Alias (byte*) f_2pi#1 = (byte*) f_2pi#2 (byte*) f_2pi#16 (byte*) f_2pi#15 (byte*) f_2pi#14 (byte*) f_2pi#13 (byte*) f_2pi#12 (byte*) f_2pi#11 (byte*) f_2pi#10 (byte*) f_2pi#8 (byte*) f_2pi#6 (byte*) f_2pi#3 +Alias (byte[]) f_i#1 = (byte[]) f_i#3 (byte[]) f_i#5 (byte[]) f_i#4 (byte[]) f_i#2 (byte[]) f_i#16 (byte[]) f_i#15 (byte[]) f_i#14 (byte[]) f_i#13 (byte[]) f_i#11 (byte[]) f_i#9 (byte[]) f_i#6 +Alias (byte[]) f_127#10 = (byte[]) f_127#11 (byte[]) f_127#9 (byte[]) f_127#8 (byte[]) f_127#7 (byte[]) f_127#5 (byte[]) f_127#2 (byte[]) f_127#3 (byte[]) f_127#16 (byte[]) f_127#15 (byte[]) f_127#14 (byte[]) f_127#12 +Alias (byte*) char_cursor#32 = (byte*) char_cursor#44 (byte*) char_cursor#45 (byte*) char_cursor#43 (byte*) char_cursor#42 (byte*) char_cursor#41 (byte*) char_cursor#40 (byte*) char_cursor#39 (byte*) char_cursor#37 (byte*) char_cursor#34 +Alias (byte[]) hextab#10 = (byte[]) hextab#13 (byte[]) hextab#14 (byte[]) hextab#12 (byte[]) hextab#11 (byte[]) hextab#9 (byte[]) hextab#8 (byte[]) hextab#7 (byte[]) hextab#6 (byte[]) hextab#5 (byte[]) hextab#18 (byte[]) hextab#15 +Alias (byte*) line_cursor#13 = (byte*) line_cursor#26 (byte*) line_cursor#27 (byte*) line_cursor#25 (byte*) line_cursor#24 (byte*) line_cursor#23 (byte*) line_cursor#22 (byte*) line_cursor#21 (byte*) line_cursor#20 (byte*) line_cursor#18 (byte*) line_cursor#15 +Alias (byte) main::i#10 = (byte) main::i#13 (byte) main::i#2 (byte) main::i#12 (byte) main::i#11 (byte) main::i#9 (byte) main::i#8 (byte) main::i#7 (byte) main::i#6 (byte) main::i#5 (byte) main::i#4 (byte) main::i#3 +Alias (word) getFAC::return#2 = (word) getFAC::return#4 +Alias (byte*) char_cursor#11 = (byte*) char_cursor#25 +Alias (byte*) line_cursor#10 = (byte*) line_cursor#3 (byte*) line_cursor#9 (byte*) line_cursor#4 +Alias (byte*) char_cursor#12 = (byte*) char_cursor#26 (byte*) char_cursor#27 (byte*) char_cursor#13 +Alias (byte[]) f_127#0 = (byte[]) f_127#6 +Alias (byte*) f_2pi#0 = (byte*) f_2pi#9 +Alias (byte[]) f_i#0 = (byte[]) f_i#12 +Alias (byte*) char_cursor#14 = (byte*) char_cursor#28 +Alias (byte*) line_cursor#11 = (byte*) line_cursor#5 +Succesful SSA optimization Pass2AliasElimination +CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) line_cursor#0 ← ((byte*)) (word/signed word) 1024 + (byte*) char_cursor#0 ← (byte*) line_cursor#0 + to:@3 +print_ln: scope:[print_ln] from main::@14 + (byte*) char_cursor#29 ← phi( main::@14/(byte*) char_cursor#11 ) + (byte*) line_cursor#12 ← phi( main::@14/(byte*) line_cursor#13 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#29 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#12 print_ln::@1/(byte*) char_cursor#16 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#16 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#16 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) char_cursor#1 ← (byte*) char_cursor#16 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) char_cursor#16 ← phi( print_ln::@2/(byte*) char_cursor#1 ) + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte[]) hextab#3 ← phi( main::@13/(byte[]) hextab#10 ) + (byte*) char_cursor#30 ← phi( main::@13/(byte*) char_cursor#32 ) + (word) print_word::w#1 ← phi( main::@13/(word) print_word::w#0 ) + (byte~) print_word::$0 ← > (word) print_word::w#1 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte*) char_cursor#17 ← phi( print_word/(byte*) char_cursor#21 ) + (byte~) print_word::$2 ← < (word) print_word::w#1 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + (byte*) char_cursor#18 ← phi( print_word::@1/(byte*) char_cursor#21 ) + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + (byte*) line_cursor#19 ← phi( @begin/(byte*) line_cursor#0 ) + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#30 print_word::@1/(byte*) char_cursor#17 ) + (byte[]) hextab#1 ← phi( print_word/(byte[]) hextab#3 print_word::@1/(byte[]) hextab#3 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#1 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte*) char_cursor#20 ← phi( print_byte/(byte*) char_cursor#10 ) + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#1 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) char_cursor#21 ← phi( print_byte::@1/(byte*) char_cursor#10 ) + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#20 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + (byte*) line_cursor#17 ← phi( @3/(byte*) line_cursor#19 ) + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) addMEMtoFAC::mem#1 ← phi( main::@11/(byte*) addMEMtoFAC::mem#0 ) + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#1 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) divMEMbyFAC::mem#1 ← phi( main::@8/(byte*) divMEMbyFAC::mem#0 ) + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#1 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte*) line_cursor#16 ← phi( @9/(byte*) line_cursor#17 ) + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (byte*) line_cursor#28 ← phi( @31/(byte*) char_cursor#0 ) + (byte[]) hextab#16 ← phi( @31/(byte[]) hextab#0 ) + (byte*) char_cursor#46 ← phi( @31/(byte*) char_cursor#0 ) + (byte[]) f_i#10 ← phi( @31/(byte[]) f_i#0 ) + (byte*) f_2pi#4 ← phi( @31/(byte*) f_2pi#0 ) + (byte[]) f_127#1 ← phi( @31/(byte[]) f_127#0 ) + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#1 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) line_cursor#10 main::@4/(byte*) line_cursor#28 ) + (byte[]) hextab#10 ← phi( main::@15/(byte[]) hextab#10 main::@4/(byte[]) hextab#16 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#12 main::@4/(byte*) char_cursor#46 ) + (byte[]) f_127#10 ← phi( main::@15/(byte[]) f_127#10 main::@4/(byte[]) f_127#1 ) + (byte[]) f_i#1 ← phi( main::@15/(byte[]) f_i#1 main::@4/(byte[]) f_i#10 ) + (byte*) f_2pi#1 ← phi( main::@15/(byte*) f_2pi#1 main::@4/(byte*) f_2pi#4 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#1 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#1 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#10 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + (byte*) char_cursor#11 ← phi( main::@13/(byte*) char_cursor#18 ) + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte*) char_cursor#12 ← phi( main::@14/(byte*) char_cursor#16 ) + (byte*) line_cursor#10 ← phi( main::@14/(byte*) char_cursor#16 ) + (byte) main::i#1 ← ++ (byte) main::i#10 + (boolean~) main::$14 ← (byte) main::i#1 != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + (byte*) char_cursor#0 ← phi( @30/(byte*) line_cursor#16 ) + call main param-assignment + to:@32 +@32: scope:[] from @31 + (byte*) line_cursor#11 ← phi( @31/(byte*) line_cursor#10 ) + (byte*) char_cursor#14 ← phi( @31/(byte*) char_cursor#12 ) + to:@end +@end: scope:[] from @32 + +Not aliassing across scopes: line_cursor#12 line_cursor#13 +Not aliassing across scopes: char_cursor#29 char_cursor#11 +Not aliassing across scopes: char_cursor#16 print_ln::$0 +Not aliassing across scopes: print_word::w#1 print_word::w#0 +Not aliassing across scopes: char_cursor#30 char_cursor#32 +Not aliassing across scopes: hextab#3 hextab#10 +Not aliassing across scopes: print_byte::b#0 print_word::$0 +Not aliassing across scopes: char_cursor#17 char_cursor#21 +Not aliassing across scopes: print_byte::b#1 print_word::$2 +Not aliassing across scopes: char_cursor#18 char_cursor#21 +Not aliassing across scopes: print_byte::b#2 print_byte::b#0 +Not aliassing across scopes: hextab#1 hextab#3 +Not aliassing across scopes: char_cursor#31 char_cursor#30 +Not aliassing across scopes: print_char::ch#0 print_byte::$1 +Not aliassing across scopes: char_cursor#20 char_cursor#10 +Not aliassing across scopes: print_char::ch#1 print_byte::$4 +Not aliassing across scopes: char_cursor#21 char_cursor#10 +Not aliassing across scopes: print_char::ch#2 print_char::ch#0 +Not aliassing across scopes: char_cursor#23 char_cursor#31 +Not aliassing across scopes: setFAC::w#3 setFAC::w#0 +Not aliassing across scopes: prepareMEM::mem#4 prepareMEM::mem#1 +Not aliassing across scopes: setMEMtoFAC::mem#2 setMEMtoFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#0 setMEMtoFAC::mem#2 +Not aliassing across scopes: addMEMtoFAC::mem#1 addMEMtoFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#1 addMEMtoFAC::mem#1 +Not aliassing across scopes: divMEMbyFAC::mem#1 divMEMbyFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#2 divMEMbyFAC::mem#1 +Not aliassing across scopes: mulFACbyMEM::mem#2 mulFACbyMEM::mem#1 +Not aliassing across scopes: prepareMEM::mem#3 mulFACbyMEM::mem#2 +Not aliassing across scopes: f_127#1 f_127#0 +Not aliassing across scopes: f_2pi#4 f_2pi#0 +Not aliassing across scopes: f_i#10 f_i#0 +Not aliassing across scopes: char_cursor#46 char_cursor#0 +Not aliassing across scopes: hextab#16 hextab#0 +Not aliassing across scopes: line_cursor#28 char_cursor#0 +Not aliassing across scopes: setMEMtoFAC::mem#0 f_127#1 +Not aliassing identity: f_2pi#1 f_2pi#1 +Not aliassing identity: f_i#1 f_i#1 +Not aliassing identity: f_127#10 f_127#10 +Not aliassing identity: hextab#10 hextab#10 +Not aliassing across scopes: setFAC::w#1 main::$2 +Not aliassing across scopes: mulFACbyMEM::mem#0 f_2pi#1 +Not aliassing across scopes: setMEMtoFAC::mem#1 f_i#1 +Not aliassing across scopes: divMEMbyFAC::mem#0 f_i#1 +Not aliassing across scopes: mulFACbyMEM::mem#1 f_127#10 +Not aliassing across scopes: addMEMtoFAC::mem#0 f_127#10 +Not aliassing across scopes: getFAC::return#2 getFAC::return#0 +Not aliassing across scopes: main::$11 getFAC::return#2 +Not aliassing across scopes: print_word::w#0 main::$11 +Not aliassing across scopes: char_cursor#11 char_cursor#18 +Not aliassing across scopes: line_cursor#10 char_cursor#16 +Not aliassing across scopes: char_cursor#12 char_cursor#16 +Not aliassing across scopes: char_cursor#14 char_cursor#12 +Not aliassing across scopes: line_cursor#11 line_cursor#10 +Alias (byte*) char_cursor#0 = (byte*) line_cursor#0 (byte*) line_cursor#19 (byte*) line_cursor#17 (byte*) line_cursor#16 +Alias (byte*) char_cursor#1 = (byte*) char_cursor#16 +Succesful SSA optimization Pass2AliasElimination +CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@3 +print_ln: scope:[print_ln] from main::@14 + (byte*) char_cursor#29 ← phi( main::@14/(byte*) char_cursor#11 ) + (byte*) line_cursor#12 ← phi( main::@14/(byte*) line_cursor#13 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#29 print_ln::@1/(byte*) char_cursor#15 ) + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#12 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#1 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte[]) hextab#3 ← phi( main::@13/(byte[]) hextab#10 ) + (byte*) char_cursor#30 ← phi( main::@13/(byte*) char_cursor#32 ) + (word) print_word::w#1 ← phi( main::@13/(word) print_word::w#0 ) + (byte~) print_word::$0 ← > (word) print_word::w#1 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte*) char_cursor#17 ← phi( print_word/(byte*) char_cursor#21 ) + (byte~) print_word::$2 ← < (word) print_word::w#1 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + (byte*) char_cursor#18 ← phi( print_word::@1/(byte*) char_cursor#21 ) + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#30 print_word::@1/(byte*) char_cursor#17 ) + (byte[]) hextab#1 ← phi( print_word/(byte[]) hextab#3 print_word::@1/(byte[]) hextab#3 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#1 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte*) char_cursor#20 ← phi( print_byte/(byte*) char_cursor#10 ) + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#1 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) char_cursor#21 ← phi( print_byte::@1/(byte*) char_cursor#10 ) + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#20 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) addMEMtoFAC::mem#1 ← phi( main::@11/(byte*) addMEMtoFAC::mem#0 ) + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#1 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) divMEMbyFAC::mem#1 ← phi( main::@8/(byte*) divMEMbyFAC::mem#0 ) + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#1 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (byte*) line_cursor#28 ← phi( @31/(byte*) char_cursor#0 ) + (byte[]) hextab#16 ← phi( @31/(byte[]) hextab#0 ) + (byte*) char_cursor#46 ← phi( @31/(byte*) char_cursor#0 ) + (byte[]) f_i#10 ← phi( @31/(byte[]) f_i#0 ) + (byte*) f_2pi#4 ← phi( @31/(byte*) f_2pi#0 ) + (byte[]) f_127#1 ← phi( @31/(byte[]) f_127#0 ) + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#1 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) line_cursor#10 main::@4/(byte*) line_cursor#28 ) + (byte[]) hextab#10 ← phi( main::@15/(byte[]) hextab#10 main::@4/(byte[]) hextab#16 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#12 main::@4/(byte*) char_cursor#46 ) + (byte[]) f_127#10 ← phi( main::@15/(byte[]) f_127#10 main::@4/(byte[]) f_127#1 ) + (byte[]) f_i#1 ← phi( main::@15/(byte[]) f_i#1 main::@4/(byte[]) f_i#10 ) + (byte*) f_2pi#1 ← phi( main::@15/(byte*) f_2pi#1 main::@4/(byte*) f_2pi#4 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#1 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#1 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#10 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + (byte*) char_cursor#11 ← phi( main::@13/(byte*) char_cursor#18 ) + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte*) char_cursor#12 ← phi( main::@14/(byte*) char_cursor#1 ) + (byte*) line_cursor#10 ← phi( main::@14/(byte*) char_cursor#1 ) + (byte) main::i#1 ← ++ (byte) main::i#10 + (boolean~) main::$14 ← (byte) main::i#1 != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + (byte*) line_cursor#11 ← phi( @31/(byte*) line_cursor#10 ) + (byte*) char_cursor#14 ← phi( @31/(byte*) char_cursor#12 ) + to:@end +@end: scope:[] from @32 + +Not aliassing across scopes: line_cursor#12 line_cursor#13 +Not aliassing across scopes: char_cursor#29 char_cursor#11 +Not aliassing across scopes: char_cursor#1 print_ln::$0 +Not aliassing across scopes: print_word::w#1 print_word::w#0 +Not aliassing across scopes: char_cursor#30 char_cursor#32 +Not aliassing across scopes: hextab#3 hextab#10 +Not aliassing across scopes: print_byte::b#0 print_word::$0 +Not aliassing across scopes: char_cursor#17 char_cursor#21 +Not aliassing across scopes: print_byte::b#1 print_word::$2 +Not aliassing across scopes: char_cursor#18 char_cursor#21 +Not aliassing across scopes: print_byte::b#2 print_byte::b#0 +Not aliassing across scopes: hextab#1 hextab#3 +Not aliassing across scopes: char_cursor#31 char_cursor#30 +Not aliassing across scopes: print_char::ch#0 print_byte::$1 +Not aliassing across scopes: char_cursor#20 char_cursor#10 +Not aliassing across scopes: print_char::ch#1 print_byte::$4 +Not aliassing across scopes: char_cursor#21 char_cursor#10 +Not aliassing across scopes: print_char::ch#2 print_char::ch#0 +Not aliassing across scopes: char_cursor#23 char_cursor#31 +Not aliassing across scopes: setFAC::w#3 setFAC::w#0 +Not aliassing across scopes: prepareMEM::mem#4 prepareMEM::mem#1 +Not aliassing across scopes: setMEMtoFAC::mem#2 setMEMtoFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#0 setMEMtoFAC::mem#2 +Not aliassing across scopes: addMEMtoFAC::mem#1 addMEMtoFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#1 addMEMtoFAC::mem#1 +Not aliassing across scopes: divMEMbyFAC::mem#1 divMEMbyFAC::mem#0 +Not aliassing across scopes: prepareMEM::mem#2 divMEMbyFAC::mem#1 +Not aliassing across scopes: mulFACbyMEM::mem#2 mulFACbyMEM::mem#1 +Not aliassing across scopes: prepareMEM::mem#3 mulFACbyMEM::mem#2 +Not aliassing across scopes: f_127#1 f_127#0 +Not aliassing across scopes: f_2pi#4 f_2pi#0 +Not aliassing across scopes: f_i#10 f_i#0 +Not aliassing across scopes: char_cursor#46 char_cursor#0 +Not aliassing across scopes: hextab#16 hextab#0 +Not aliassing across scopes: line_cursor#28 char_cursor#0 +Not aliassing across scopes: setMEMtoFAC::mem#0 f_127#1 +Not aliassing identity: f_2pi#1 f_2pi#1 +Not aliassing identity: f_i#1 f_i#1 +Not aliassing identity: f_127#10 f_127#10 +Not aliassing identity: hextab#10 hextab#10 +Not aliassing across scopes: setFAC::w#1 main::$2 +Not aliassing across scopes: mulFACbyMEM::mem#0 f_2pi#1 +Not aliassing across scopes: setMEMtoFAC::mem#1 f_i#1 +Not aliassing across scopes: divMEMbyFAC::mem#0 f_i#1 +Not aliassing across scopes: mulFACbyMEM::mem#1 f_127#10 +Not aliassing across scopes: addMEMtoFAC::mem#0 f_127#10 +Not aliassing across scopes: getFAC::return#2 getFAC::return#0 +Not aliassing across scopes: main::$11 getFAC::return#2 +Not aliassing across scopes: print_word::w#0 main::$11 +Not aliassing across scopes: char_cursor#11 char_cursor#18 +Not aliassing across scopes: line_cursor#10 char_cursor#1 +Not aliassing across scopes: char_cursor#12 char_cursor#1 +Not aliassing across scopes: char_cursor#14 char_cursor#12 +Not aliassing across scopes: line_cursor#11 line_cursor#10 +Self Phi Eliminated (byte*) char_cursor#15 +Self Phi Eliminated (byte*) f_2pi#1 +Self Phi Eliminated (byte[]) f_i#1 +Self Phi Eliminated (byte[]) f_127#10 +Self Phi Eliminated (byte[]) hextab#10 +Succesful SSA optimization Pass2SelfPhiElimination +CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@3 +print_ln: scope:[print_ln] from main::@14 + (byte*) char_cursor#29 ← phi( main::@14/(byte*) char_cursor#11 ) + (byte*) line_cursor#12 ← phi( main::@14/(byte*) line_cursor#13 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) char_cursor#15 ← phi( print_ln/(byte*) char_cursor#29 ) + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#12 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#1 < (byte*) char_cursor#15 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte[]) hextab#3 ← phi( main::@13/(byte[]) hextab#10 ) + (byte*) char_cursor#30 ← phi( main::@13/(byte*) char_cursor#32 ) + (word) print_word::w#1 ← phi( main::@13/(word) print_word::w#0 ) + (byte~) print_word::$0 ← > (word) print_word::w#1 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte*) char_cursor#17 ← phi( print_word/(byte*) char_cursor#21 ) + (byte~) print_word::$2 ← < (word) print_word::w#1 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + (byte*) char_cursor#18 ← phi( print_word::@1/(byte*) char_cursor#21 ) + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#30 print_word::@1/(byte*) char_cursor#17 ) + (byte[]) hextab#1 ← phi( print_word/(byte[]) hextab#3 print_word::@1/(byte[]) hextab#3 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#1 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte*) char_cursor#20 ← phi( print_byte/(byte*) char_cursor#10 ) + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#1 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + (byte*) char_cursor#21 ← phi( print_byte::@1/(byte*) char_cursor#10 ) + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#20 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) addMEMtoFAC::mem#1 ← phi( main::@11/(byte*) addMEMtoFAC::mem#0 ) + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#1 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) divMEMbyFAC::mem#1 ← phi( main::@8/(byte*) divMEMbyFAC::mem#0 ) + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#1 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (byte*) line_cursor#28 ← phi( @31/(byte*) char_cursor#0 ) + (byte[]) hextab#16 ← phi( @31/(byte[]) hextab#0 ) + (byte*) char_cursor#46 ← phi( @31/(byte*) char_cursor#0 ) + (byte[]) f_i#10 ← phi( @31/(byte[]) f_i#0 ) + (byte*) f_2pi#4 ← phi( @31/(byte*) f_2pi#0 ) + (byte[]) f_127#1 ← phi( @31/(byte[]) f_127#0 ) + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#1 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) line_cursor#10 main::@4/(byte*) line_cursor#28 ) + (byte[]) hextab#10 ← phi( main::@4/(byte[]) hextab#16 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#12 main::@4/(byte*) char_cursor#46 ) + (byte[]) f_127#10 ← phi( main::@4/(byte[]) f_127#1 ) + (byte[]) f_i#1 ← phi( main::@4/(byte[]) f_i#10 ) + (byte*) f_2pi#1 ← phi( main::@4/(byte*) f_2pi#4 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#1 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#1 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#10 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + (byte*) char_cursor#11 ← phi( main::@13/(byte*) char_cursor#18 ) + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte*) char_cursor#12 ← phi( main::@14/(byte*) char_cursor#1 ) + (byte*) line_cursor#10 ← phi( main::@14/(byte*) char_cursor#1 ) + (byte) main::i#1 ← ++ (byte) main::i#10 + (boolean~) main::$14 ← (byte) main::i#1 != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + (byte*) line_cursor#11 ← phi( @31/(byte*) line_cursor#10 ) + (byte*) char_cursor#14 ← phi( @31/(byte*) char_cursor#12 ) + to:@end +@end: scope:[] from @32 + +Redundant Phi (byte*) line_cursor#12 (byte*) line_cursor#13 +Redundant Phi (byte*) char_cursor#29 (byte*) char_cursor#11 +Redundant Phi (byte*) char_cursor#15 (byte*) char_cursor#29 +Redundant Phi (word) print_word::w#1 (word) print_word::w#0 +Redundant Phi (byte*) char_cursor#30 (byte*) char_cursor#32 +Redundant Phi (byte[]) hextab#3 (byte[]) hextab#10 +Redundant Phi (byte*) char_cursor#17 (byte*) char_cursor#21 +Redundant Phi (byte*) char_cursor#18 (byte*) char_cursor#21 +Redundant Phi (byte[]) hextab#1 (byte[]) hextab#3 +Redundant Phi (byte*) char_cursor#20 (byte*) char_cursor#10 +Redundant Phi (byte*) char_cursor#21 (byte*) char_cursor#10 +Redundant Phi (byte*) addMEMtoFAC::mem#1 (byte*) addMEMtoFAC::mem#0 +Redundant Phi (byte*) divMEMbyFAC::mem#1 (byte*) divMEMbyFAC::mem#0 +Redundant Phi (byte[]) f_127#1 (byte[]) f_127#0 +Redundant Phi (byte*) f_2pi#4 (byte*) f_2pi#0 +Redundant Phi (byte[]) f_i#10 (byte[]) f_i#0 +Redundant Phi (byte*) char_cursor#46 (byte*) char_cursor#0 +Redundant Phi (byte[]) hextab#16 (byte[]) hextab#0 +Redundant Phi (byte*) line_cursor#28 (byte*) char_cursor#0 +Redundant Phi (byte*) f_2pi#1 (byte*) f_2pi#4 +Redundant Phi (byte[]) f_i#1 (byte[]) f_i#10 +Redundant Phi (byte[]) f_127#10 (byte[]) f_127#1 +Redundant Phi (byte[]) hextab#10 (byte[]) hextab#16 +Redundant Phi (byte*) char_cursor#11 (byte*) char_cursor#18 +Redundant Phi (byte*) line_cursor#10 (byte*) char_cursor#1 +Redundant Phi (byte*) char_cursor#12 (byte*) char_cursor#1 +Redundant Phi (byte*) char_cursor#14 (byte*) char_cursor#12 +Redundant Phi (byte*) line_cursor#11 (byte*) line_cursor#10 +Succesful SSA optimization Pass2RedundantPhiElimination +CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@3 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) char_cursor#1 < (byte*) char_cursor#10 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#0 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#0 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#0 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#0 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#0 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#0 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#0 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#0 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + (boolean~) main::$14 ← (byte) main::i#1 != (byte/signed byte/word/signed word) 26 + if((boolean~) main::$14) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + to:@end +@end: scope:[] from @32 + +Simple Condition (boolean~) print_ln::$1 if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 +Simple Condition (boolean~) main::$14 if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 +Succesful SSA optimization Pass2ConditionalJumpSimplification +CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) char_cursor#0 ← ((byte*)) (word/signed word) 1024 + to:@3 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + (byte[]) hextab#0 ← { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(word) setFAC::w#2 ) + (byte*) setFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) setFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + (byte*) getFAC::lo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) getFAC::hi#0 ← ((byte*)) (byte/word/signed word) 255 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#0 ← (byte/signed byte/word/signed word) 0 + (word) getFAC::w#1 ← (word) getFAC::w#0 lo= *((byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + (byte*) memLo#0 ← ((byte*)) (byte/word/signed word) 254 + (byte*) memHi#0 ← ((byte*)) (byte/word/signed word) 255 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#0 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#0 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + (byte[]) f_i#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte[]) f_127#0 ← { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } + (byte*) f_2pi#0 ← ((byte*)) (word) 58085 + to:@31 +main: scope:[main] from @31 + (word) setFAC::w#0 ← (byte/signed byte/word/signed word) 127 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem#0 ← (byte[]) f_127#0 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte) main::i#0 ← (byte/signed byte/word/signed word) 1 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem#0 ← (byte*) f_2pi#0 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem#1 ← (byte[]) f_i#0 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + (word) setFAC::w#2 ← (byte/signed byte/word/signed word) 25 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem#0 ← (byte[]) f_i#0 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem#1 ← (byte[]) f_127#0 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem#0 ← (byte[]) f_127#0 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + to:@end +@end: scope:[] from @32 + +Constant (const byte*) char_cursor#0 = ((byte*))1024 +Constant (const byte[]) hextab#0 = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' } +Constant (const byte*) setFAC::lo#0 = ((byte*))254 +Constant (const byte*) setFAC::hi#0 = ((byte*))255 +Constant (const byte*) getFAC::lo#0 = ((byte*))254 +Constant (const byte*) getFAC::hi#0 = ((byte*))255 +Constant (const word) getFAC::w#0 = 0 +Constant (const byte*) memLo#0 = ((byte*))254 +Constant (const byte*) memHi#0 = ((byte*))255 +Constant (const byte[]) f_i#0 = { 0, 0, 0, 0, 0 } +Constant (const byte[]) f_127#0 = { 0, 0, 0, 0, 0 } +Constant (const byte*) f_2pi#0 = ((byte*))58085 +Constant (const word) setFAC::w#0 = 127 +Constant (const byte) main::i#0 = 1 +Constant (const word) setFAC::w#2 = 25 +Succesful SSA optimization Pass2ConstantIdentification +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@3 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(const word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(const word) setFAC::w#2 ) + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#1 ← (const word) getFAC::w#0 lo= *((const byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(byte*) setMEMtoFAC::mem#0 main::@6/(byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) prepareMEM::mem#1 ← (byte*) addMEMtoFAC::mem#0 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) prepareMEM::mem#2 ← (byte*) divMEMbyFAC::mem#0 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(byte*) mulFACbyMEM::mem#1 main::@5/(byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + to:@31 +main: scope:[main] from @31 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + (byte*) setMEMtoFAC::mem#0 ← (const byte[]) f_127#0 + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(const byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(const byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(const byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + (byte*) mulFACbyMEM::mem#0 ← (const byte*) f_2pi#0 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + (byte*) setMEMtoFAC::mem#1 ← (const byte[]) f_i#0 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + (byte*) divMEMbyFAC::mem#0 ← (const byte[]) f_i#0 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + (byte*) mulFACbyMEM::mem#1 ← (const byte[]) f_127#0 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) addMEMtoFAC::mem#0 ← (const byte[]) f_127#0 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + to:@end +@end: scope:[] from @32 + +Constant (const byte*) setMEMtoFAC::mem#0 = f_127#0 +Constant (const byte*) mulFACbyMEM::mem#0 = f_2pi#0 +Constant (const byte*) setMEMtoFAC::mem#1 = f_i#0 +Constant (const byte*) divMEMbyFAC::mem#0 = f_i#0 +Constant (const byte*) mulFACbyMEM::mem#1 = f_127#0 +Constant (const byte*) addMEMtoFAC::mem#0 = f_127#0 +Succesful SSA optimization Pass2ConstantIdentification +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@3 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(const word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(const word) setFAC::w#2 ) + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#1 ← (const word) getFAC::w#0 lo= *((const byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(byte*) prepareMEM::mem#1 divMEMbyFAC/(byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte*) setMEMtoFAC::mem#0 main::@6/(const byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + (byte*) prepareMEM::mem#1 ← (const byte*) addMEMtoFAC::mem#0 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + (byte*) prepareMEM::mem#2 ← (const byte*) divMEMbyFAC::mem#0 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte*) mulFACbyMEM::mem#1 main::@5/(const byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + to:@31 +main: scope:[main] from @31 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(const byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(const byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(const byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + to:@end +@end: scope:[] from @32 + +Constant (const byte*) prepareMEM::mem#1 = addMEMtoFAC::mem#0 +Constant (const byte*) prepareMEM::mem#2 = divMEMbyFAC::mem#0 +Succesful SSA optimization Pass2ConstantIdentification +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@3 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@2 +print_word::@2: scope:[print_word] from print_word::@1 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@2 + return + to:@return +@3: scope:[] from @begin + to:@9 +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@2 +print_byte::@2: scope:[print_byte] from print_byte::@1 + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@2 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(const word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(const word) setFAC::w#2 ) + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#1 ← (const word) getFAC::w#0 lo= *((const byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +@9: scope:[] from @3 + to:@30 +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte*) prepareMEM::mem#1 divMEMbyFAC/(const byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte*) setMEMtoFAC::mem#0 main::@6/(const byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte*) mulFACbyMEM::mem#1 main::@5/(const byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +@30: scope:[] from @9 + to:@31 +main: scope:[main] from @31 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + call setMEMtoFAC param-assignment + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@1 +main::@1: scope:[main] from main::@15 main::@4 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(const byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@4/(const byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@4/(const byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @30 + call main param-assignment + to:@32 +@32: scope:[] from @31 + to:@end +@end: scope:[] from @32 + +Culled Empty Block (label) print_ln::@2 +Culled Empty Block (label) print_word::@2 +Culled Empty Block (label) @3 +Culled Empty Block (label) print_byte::@2 +Culled Empty Block (label) @9 +Culled Empty Block (label) @30 +Culled Empty Block (label) main::@4 +Culled Empty Block (label) @32 +Succesful SSA optimization Pass2CullEmptyBlocks +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@31 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + return + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(const word) setFAC::w#0 main::@1/(word) setFAC::w#1 main::@7/(const word) setFAC::w#2 ) + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#1 ← (const word) getFAC::w#0 lo= *((const byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte*) prepareMEM::mem#1 divMEMbyFAC/(const byte*) prepareMEM::mem#2 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte*) setMEMtoFAC::mem#0 main::@6/(const byte*) setMEMtoFAC::mem#1 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte*) mulFACbyMEM::mem#1 main::@5/(const byte*) mulFACbyMEM::mem#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +main: scope:[main] from @31 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + call setMEMtoFAC param-assignment + to:main::@1 +main::@1: scope:[main] from main::@15 main::@3 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@3/(const byte*) char_cursor#0 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@3/(const byte*) char_cursor#0 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@3/(const byte) main::i#0 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @begin + call main param-assignment + to:@end +@end: scope:[] from @31 + +Not aliassing across scopes: line_cursor#6 line_cursor#13 +Not aliassing across scopes: char_cursor#1 print_ln::$0 +Not aliassing across scopes: print_byte::b#0 print_word::$0 +Not aliassing across scopes: print_byte::b#1 print_word::$2 +Not aliassing across scopes: print_byte::b#2 print_byte::b#0 +Not aliassing across scopes: char_cursor#31 char_cursor#32 +Not aliassing across scopes: print_char::ch#0 print_byte::$1 +Not aliassing across scopes: print_char::ch#1 print_byte::$4 +Not aliassing across scopes: print_char::ch#2 print_char::ch#0 +Not aliassing across scopes: char_cursor#23 char_cursor#31 +Not aliassing across scopes: prepareMEM::mem#0 setMEMtoFAC::mem#2 +Not aliassing across scopes: prepareMEM::mem#3 mulFACbyMEM::mem#2 +Not aliassing across scopes: char_cursor#32 char_cursor#1 +Not aliassing across scopes: line_cursor#13 char_cursor#1 +Not aliassing across scopes: setFAC::w#1 main::$2 +Not aliassing across scopes: getFAC::return#2 getFAC::return#0 +Not aliassing across scopes: main::$11 getFAC::return#2 +Not aliassing across scopes: print_word::w#0 main::$11 +Not aliassing across scopes: line_cursor#6 line_cursor#13 +Not aliassing across scopes: char_cursor#1 print_ln::$0 +Not aliassing across scopes: print_byte::b#0 print_word::$0 +Not aliassing across scopes: print_byte::b#1 print_word::$2 +Not aliassing across scopes: print_byte::b#2 print_byte::b#0 +Not aliassing across scopes: char_cursor#31 char_cursor#32 +Not aliassing across scopes: print_char::ch#0 print_byte::$1 +Not aliassing across scopes: print_char::ch#1 print_byte::$4 +Not aliassing across scopes: print_char::ch#2 print_char::ch#0 +Not aliassing across scopes: char_cursor#23 char_cursor#31 +Not aliassing across scopes: prepareMEM::mem#0 setMEMtoFAC::mem#2 +Not aliassing across scopes: prepareMEM::mem#3 mulFACbyMEM::mem#2 +Not aliassing across scopes: char_cursor#32 char_cursor#1 +Not aliassing across scopes: line_cursor#13 char_cursor#1 +Not aliassing across scopes: setFAC::w#1 main::$2 +Not aliassing across scopes: getFAC::return#2 getFAC::return#0 +Not aliassing across scopes: main::$11 getFAC::return#2 +Not aliassing across scopes: print_word::w#0 main::$11 +Inlining constant with var siblings (const word) setFAC::w#0 +Inlining constant with var siblings (const word) setFAC::w#0 +Inlining constant with different constant siblings (const word) setFAC::w#0 +Inlining constant with var siblings (const word) setFAC::w#2 +Inlining constant with var siblings (const word) setFAC::w#2 +Inlining constant with different constant siblings (const word) setFAC::w#2 +Inlining constant with var siblings (const word) getFAC::w#0 +Inlining constant with var siblings (const byte*) prepareMEM::mem#1 +Inlining constant with var siblings (const byte*) prepareMEM::mem#1 +Inlining constant with var siblings (const byte*) prepareMEM::mem#1 +Inlining constant with var siblings (const byte*) prepareMEM::mem#2 +Inlining constant with var siblings (const byte*) prepareMEM::mem#2 +Inlining constant with var siblings (const byte*) prepareMEM::mem#2 +Inlining constant with var siblings (const byte*) setMEMtoFAC::mem#0 +Inlining constant with var siblings (const byte*) setMEMtoFAC::mem#1 +Inlining constant with var siblings (const byte*) mulFACbyMEM::mem#0 +Inlining constant with var siblings (const byte*) mulFACbyMEM::mem#1 +Inlining constant with var siblings (const byte) main::i#0 +Inlining constant with var siblings (const byte) main::i#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Inlining constant with var siblings (const byte*) char_cursor#0 +Constant inlined addMEMtoFAC::mem#0 = (const byte[]) f_127#0 +Constant inlined setFAC::w#2 = (byte/signed byte/word/signed word) 25 +Constant inlined prepareMEM::mem#1 = (const byte[]) f_127#0 +Constant inlined prepareMEM::mem#2 = (const byte[]) f_i#0 +Constant inlined divMEMbyFAC::mem#0 = (const byte[]) f_i#0 +Constant inlined main::i#0 = (byte/signed byte/word/signed word) 1 +Constant inlined setMEMtoFAC::mem#1 = (const byte[]) f_i#0 +Constant inlined mulFACbyMEM::mem#0 = (const byte*) f_2pi#0 +Constant inlined char_cursor#0 = ((byte*))(word/signed word) 1024 +Constant inlined setMEMtoFAC::mem#0 = (const byte[]) f_127#0 +Constant inlined mulFACbyMEM::mem#1 = (const byte[]) f_127#0 +Constant inlined getFAC::w#0 = (byte/signed byte/word/signed word) 0 +Constant inlined setFAC::w#0 = (byte/signed byte/word/signed word) 127 +Succesful SSA optimization Pass2ConstantInlining +CONTROL FLOW GRAPH +@begin: scope:[] from + to:@31 +print_ln: scope:[print_ln] from main::@14 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) char_cursor#1 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + return + to:@return +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + call print_byte param-assignment + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + return + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) + (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + call print_char param-assignment + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(byte/signed byte/word/signed word) 127 main::@1/(word) setFAC::w#1 main::@7/(byte/signed byte/word/signed word) 25 ) + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte[]) f_127#0 main::@6/(const byte[]) f_i#0 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte[]) f_127#0 main::@5/(const byte*) f_2pi#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +main: scope:[main] from @31 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + call setMEMtoFAC param-assignment + to:main::@1 +main::@1: scope:[main] from main::@15 main::@3 + (byte*) line_cursor#13 ← phi( main::@15/(byte*) char_cursor#1 main::@3/((byte*))(word/signed word) 1024 ) + (byte*) char_cursor#32 ← phi( main::@15/(byte*) char_cursor#1 main::@3/((byte*))(word/signed word) 1024 ) + (byte) main::i#10 ← phi( main::@15/(byte) main::i#1 main::@3/(byte/signed byte/word/signed word) 1 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +@31: scope:[] from @begin + call main param-assignment + to:@end +@end: scope:[] from @31 + +FINAL SYMBOL TABLE +(label) @31 +(label) @begin +(label) @end +(void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) +(label) addMEMtoFAC::@1 +(label) addMEMtoFAC::@return +(byte*) addMEMtoFAC::mem +(byte*) char_cursor +(byte*) char_cursor#1 +(byte*) char_cursor#10 +(byte*) char_cursor#23 +(byte*) char_cursor#31 +(byte*) char_cursor#32 +(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) +(label) divMEMbyFAC::@1 +(label) divMEMbyFAC::@return +(byte*) divMEMbyFAC::mem +(byte[]) f_127 +(const byte[]) f_127#0 = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } +(byte*) f_2pi +(const byte*) f_2pi#0 = ((byte*))(word) 58085 +(byte[]) f_i +(const byte[]) f_i#0 = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } +(word()) getFAC() +(label) getFAC::@return +(byte*) getFAC::hi +(const byte*) getFAC::hi#0 = ((byte*))(byte/word/signed word) 255 +(byte*) getFAC::lo +(const byte*) getFAC::lo#0 = ((byte*))(byte/word/signed word) 254 +(word) getFAC::return +(word) getFAC::return#0 +(word) getFAC::return#2 +(word) getFAC::w +(word) getFAC::w#1 +(byte[]) hextab +(const byte[]) hextab#0 = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } +(byte*) line_cursor +(byte*) line_cursor#13 +(byte*) line_cursor#6 +(void()) main() +(word~) main::$11 +(word~) main::$2 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@14 +(label) main::@15 +(label) main::@3 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(label) main::@return +(byte) main::i +(byte) main::i#1 +(byte) main::i#10 +(byte*) memHi +(const byte*) memHi#0 = ((byte*))(byte/word/signed word) 255 +(byte*) memLo +(const byte*) memLo#0 = ((byte*))(byte/word/signed word) 254 +(void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) +(label) mulFACbyMEM::@1 +(label) mulFACbyMEM::@return +(byte*) mulFACbyMEM::mem +(byte*) mulFACbyMEM::mem#2 +(void()) prepareMEM((byte*) prepareMEM::mem) +(byte~) prepareMEM::$0 +(byte~) prepareMEM::$1 +(label) prepareMEM::@return +(byte*) prepareMEM::mem +(byte*) prepareMEM::mem#0 +(byte*) prepareMEM::mem#3 +(byte*) prepareMEM::mem#4 +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 +(byte~) print_byte::$1 +(byte~) print_byte::$3 +(byte~) print_byte::$4 +(label) print_byte::@1 +(label) print_byte::@return +(byte) print_byte::b +(byte) print_byte::b#0 +(byte) print_byte::b#1 +(byte) print_byte::b#2 +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(byte) print_char::ch#0 +(byte) print_char::ch#1 +(byte) print_char::ch#2 +(void()) print_ln() +(byte*~) print_ln::$0 +(label) print_ln::@1 +(label) print_ln::@return +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 +(byte~) print_word::$2 +(label) print_word::@1 +(label) print_word::@return +(word) print_word::w +(word) print_word::w#0 +(void()) setFAC((word) setFAC::w) +(byte~) setFAC::$0 +(byte~) setFAC::$1 +(label) setFAC::@return +(byte*) setFAC::hi +(const byte*) setFAC::hi#0 = ((byte*))(byte/word/signed word) 255 +(byte*) setFAC::lo +(const byte*) setFAC::lo#0 = ((byte*))(byte/word/signed word) 254 +(word) setFAC::w +(word) setFAC::w#1 +(word) setFAC::w#3 +(void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) +(label) setMEMtoFAC::@1 +(label) setMEMtoFAC::@return +(byte*) setMEMtoFAC::mem +(byte*) setMEMtoFAC::mem#2 +(void()) sinFAC() +(label) sinFAC::@return + +Block Sequence Planned @begin @31 @end main main::@3 main::@1 main::@5 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@return print_ln print_ln::@1 print_ln::@return print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return +Added new block during phi lifting main::@16(between main::@15 and main::@1) +Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) +Block Sequence Planned @begin @31 @end main main::@3 main::@1 main::@5 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@return main::@16 print_ln print_ln::@1 print_ln::@return print_ln::@3 print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return +CONTROL FLOW GRAPH - PHI LIFTED +@begin: scope:[] from + to:@31 +@31: scope:[] from @begin + call main param-assignment + to:@end +@end: scope:[] from @31 +main: scope:[main] from @31 + call setFAC param-assignment + to:main::@3 +main::@3: scope:[main] from main + call setMEMtoFAC param-assignment + to:main::@1 +main::@1: scope:[main] from main::@16 main::@3 + (byte*) line_cursor#13 ← phi( main::@16/(byte*~) char_cursor#50 main::@3/((byte*))(word/signed word) 1024 ) + (byte*) char_cursor#32 ← phi( main::@16/(byte*~) char_cursor#49 main::@3/((byte*))(word/signed word) 1024 ) + (byte) main::i#10 ← phi( main::@16/(byte~) main::i#14 main::@3/(byte/signed byte/word/signed word) 1 ) + (word~) main::$2 ← ((word)) (byte) main::i#10 + (word) setFAC::w#1 ← (word~) main::$2 + (word~) setFAC::w#4 ← (word) setFAC::w#1 + call setFAC param-assignment + to:main::@5 +main::@5: scope:[main] from main::@1 + call mulFACbyMEM param-assignment + to:main::@6 +main::@6: scope:[main] from main::@5 + call setMEMtoFAC param-assignment + to:main::@7 +main::@7: scope:[main] from main::@6 + call setFAC param-assignment + to:main::@8 +main::@8: scope:[main] from main::@7 + call divMEMbyFAC param-assignment + to:main::@9 +main::@9: scope:[main] from main::@8 + call sinFAC param-assignment + to:main::@10 +main::@10: scope:[main] from main::@9 + call mulFACbyMEM param-assignment + to:main::@11 +main::@11: scope:[main] from main::@10 + call addMEMtoFAC param-assignment + to:main::@12 +main::@12: scope:[main] from main::@11 + call getFAC param-assignment + (word) getFAC::return#2 ← (word) getFAC::return#0 + to:main::@13 +main::@13: scope:[main] from main::@12 + (word~) main::$11 ← (word) getFAC::return#2 + (word) print_word::w#0 ← (word~) main::$11 + call print_word param-assignment + to:main::@14 +main::@14: scope:[main] from main::@13 + call print_ln param-assignment + to:main::@15 +main::@15: scope:[main] from main::@14 + (byte) main::i#1 ← ++ (byte) main::i#10 + if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 + to:main::@return +main::@return: scope:[main] from main::@15 + return + to:@return +main::@16: scope:[main] from main::@15 + (byte~) main::i#14 ← (byte) main::i#1 + (byte*~) char_cursor#49 ← (byte*) char_cursor#1 + (byte*~) char_cursor#50 ← (byte*) char_cursor#1 + to:main::@1 +print_ln: scope:[print_ln] from main::@14 + (byte*~) line_cursor#31 ← (byte*) line_cursor#13 + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@3 + (byte*) line_cursor#6 ← phi( print_ln/(byte*~) line_cursor#31 print_ln::@3/(byte*~) char_cursor#51 ) + (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 + (byte*) char_cursor#1 ← (byte*~) print_ln::$0 + if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@3 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + return + to:@return +print_ln::@3: scope:[print_ln] from print_ln::@1 + (byte*~) char_cursor#51 ← (byte*) char_cursor#1 + to:print_ln::@1 +print_word: scope:[print_word] from main::@13 + (byte~) print_word::$0 ← > (word) print_word::w#0 + (byte) print_byte::b#0 ← (byte~) print_word::$0 + (byte~) print_byte::b#4 ← (byte) print_byte::b#0 + (byte*~) char_cursor#52 ← (byte*) char_cursor#32 + call print_byte param-assignment + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + (byte~) print_word::$2 ← < (word) print_word::w#0 + (byte) print_byte::b#1 ← (byte~) print_word::$2 + (byte~) print_byte::b#5 ← (byte) print_byte::b#1 + (byte*~) char_cursor#53 ← (byte*) char_cursor#10 + call print_byte param-assignment + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + return + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + (byte*) char_cursor#31 ← phi( print_word/(byte*~) char_cursor#52 print_word::@1/(byte*~) char_cursor#53 ) + (byte) print_byte::b#2 ← phi( print_word/(byte~) print_byte::b#4 print_word::@1/(byte~) print_byte::b#5 ) + (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 + (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 + (byte) print_char::ch#0 ← (byte~) print_byte::$1 + (byte~) print_char::ch#3 ← (byte) print_char::ch#0 + (byte*~) char_cursor#54 ← (byte*) char_cursor#31 + call print_char param-assignment + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 + (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 + (byte) print_char::ch#1 ← (byte~) print_byte::$4 + (byte~) print_char::ch#4 ← (byte) print_char::ch#1 + (byte*~) char_cursor#55 ← (byte*) char_cursor#10 + call print_char param-assignment + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + return + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + (byte*) char_cursor#23 ← phi( print_byte/(byte*~) char_cursor#54 print_byte::@1/(byte*~) char_cursor#55 ) + (byte) print_char::ch#2 ← phi( print_byte/(byte~) print_char::ch#3 print_byte::@1/(byte~) print_char::ch#4 ) + *((byte*) char_cursor#23) ← (byte) print_char::ch#2 + (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) + (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + return + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + call prepareMEM param-assignment + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + return + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*~) prepareMEM::mem#5 setMEMtoFAC/(byte*~) prepareMEM::mem#6 ) + (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 + *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 + (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 + *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + return + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte[]) f_127#0 main::@5/(const byte*) f_2pi#0 ) + (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 + (byte*~) prepareMEM::mem#5 ← (byte*) prepareMEM::mem#3 + call prepareMEM param-assignment + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + return + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + return + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + call prepareMEM param-assignment + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + return + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + (word) setFAC::w#3 ← phi( main/(byte/signed byte/word/signed word) 127 main::@1/(word~) setFAC::w#4 main::@7/(byte/signed byte/word/signed word) 25 ) + (byte~) setFAC::$0 ← < (word) setFAC::w#3 + *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 + (byte~) setFAC::$1 ← > (word) setFAC::w#3 + *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + return + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte[]) f_127#0 main::@6/(const byte[]) f_i#0 ) + (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 + (byte*~) prepareMEM::mem#6 ← (byte*) prepareMEM::mem#0 + call prepareMEM param-assignment + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + return + to:@return + +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @31 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of main::@5 +Adding NOP phi() at start of main::@6 +Adding NOP phi() at start of main::@7 +Adding NOP phi() at start of main::@8 +Adding NOP phi() at start of main::@9 +Adding NOP phi() at start of main::@10 +Adding NOP phi() at start of main::@11 +Adding NOP phi() at start of main::@12 +Adding NOP phi() at start of main::@14 +Adding NOP phi() at start of addMEMtoFAC +Adding NOP phi() at start of divMEMbyFAC +CALL GRAPH +Calls in [] to main:2 +Calls in [main] to setFAC:5 setMEMtoFAC:7 setFAC:12 mulFACbyMEM:14 setMEMtoFAC:16 setFAC:18 divMEMbyFAC:20 sinFAC:22 mulFACbyMEM:24 addMEMtoFAC:26 getFAC:28 print_word:32 print_ln:34 +Calls in [print_word] to print_byte:52 print_byte:57 +Calls in [print_byte] to print_char:65 print_char:71 +Calls in [addMEMtoFAC] to prepareMEM:82 +Calls in [mulFACbyMEM] to prepareMEM:94 +Calls in [divMEMbyFAC] to prepareMEM:100 +Calls in [setMEMtoFAC] to prepareMEM:113 + +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +CONTROL FLOW GRAPH - LIVE RANGES FOUND +@begin: scope:[] from + [0] phi() [ ] + to:@31 +@31: scope:[] from @begin + [1] phi() [ ] + [2] call main param-assignment [ ] + to:@end +@end: scope:[] from @31 + [3] phi() [ ] +main: scope:[main] from @31 + [4] phi() [ ] + [5] call setFAC param-assignment [ ] + to:main::@3 +main::@3: scope:[main] from main + [6] phi() [ ] + [7] call setMEMtoFAC param-assignment [ ] + to:main::@1 +main::@1: scope:[main] from main::@16 main::@3 + [8] (byte*) line_cursor#13 ← phi( main::@16/(byte*~) char_cursor#50 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] + [8] (byte*) char_cursor#32 ← phi( main::@16/(byte*~) char_cursor#49 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] + [8] (byte) main::i#10 ← phi( main::@16/(byte~) main::i#14 main::@3/(byte/signed byte/word/signed word) 1 ) [ main::i#10 char_cursor#32 line_cursor#13 ] + [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] + [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] + [11] (word~) setFAC::w#4 ← (word) setFAC::w#1 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#4 ] + [12] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@5 +main::@5: scope:[main] from main::@1 + [13] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [14] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@6 +main::@6: scope:[main] from main::@5 + [15] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [16] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@7 +main::@7: scope:[main] from main::@6 + [17] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [18] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@8 +main::@8: scope:[main] from main::@7 + [19] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [20] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@9 +main::@9: scope:[main] from main::@8 + [21] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [22] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@10 +main::@10: scope:[main] from main::@9 + [23] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [24] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@11 +main::@11: scope:[main] from main::@10 + [25] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [26] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@12 +main::@12: scope:[main] from main::@11 + [27] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [28] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] + [29] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] + to:main::@13 +main::@13: scope:[main] from main::@12 + [30] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] + [31] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] + [32] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] + to:main::@14 +main::@14: scope:[main] from main::@13 + [33] phi() [ main::i#10 line_cursor#13 char_cursor#10 ] + [34] call print_ln param-assignment [ main::i#10 char_cursor#1 ] + to:main::@15 +main::@15: scope:[main] from main::@14 + [35] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 char_cursor#1 ] + [36] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 char_cursor#1 ] + to:main::@return +main::@return: scope:[main] from main::@15 + [37] return [ ] + to:@return +main::@16: scope:[main] from main::@15 + [38] (byte~) main::i#14 ← (byte) main::i#1 [ main::i#14 char_cursor#1 ] + [39] (byte*~) char_cursor#49 ← (byte*) char_cursor#1 [ main::i#14 char_cursor#49 char_cursor#1 ] + [40] (byte*~) char_cursor#50 ← (byte*) char_cursor#1 [ main::i#14 char_cursor#49 char_cursor#50 ] + to:main::@1 +print_ln: scope:[print_ln] from main::@14 + [41] (byte*~) line_cursor#31 ← (byte*) line_cursor#13 [ line_cursor#31 char_cursor#10 ] + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@3 + [42] (byte*) line_cursor#6 ← phi( print_ln/(byte*~) line_cursor#31 print_ln::@3/(byte*~) char_cursor#51 ) [ line_cursor#6 char_cursor#10 ] + [43] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] + [44] (byte*) char_cursor#1 ← (byte*~) print_ln::$0 [ char_cursor#1 char_cursor#10 ] + [45] if((byte*) char_cursor#1<(byte*) char_cursor#10) goto print_ln::@3 [ char_cursor#1 char_cursor#10 ] + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [46] return [ char_cursor#1 ] + to:@return +print_ln::@3: scope:[print_ln] from print_ln::@1 + [47] (byte*~) char_cursor#51 ← (byte*) char_cursor#1 [ char_cursor#51 char_cursor#10 ] + to:print_ln::@1 +print_word: scope:[print_word] from main::@13 + [48] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] + [49] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] + [50] (byte~) print_byte::b#4 ← (byte) print_byte::b#0 [ char_cursor#32 print_word::w#0 print_byte::b#4 ] + [51] (byte*~) char_cursor#52 ← (byte*) char_cursor#32 [ print_word::w#0 print_byte::b#4 char_cursor#52 ] + [52] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + [53] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] + [54] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] + [55] (byte~) print_byte::b#5 ← (byte) print_byte::b#1 [ char_cursor#10 print_byte::b#5 ] + [56] (byte*~) char_cursor#53 ← (byte*) char_cursor#10 [ print_byte::b#5 char_cursor#53 ] + [57] call print_byte param-assignment [ char_cursor#10 ] + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + [58] return [ char_cursor#10 ] + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + [59] (byte*) char_cursor#31 ← phi( print_word/(byte*~) char_cursor#52 print_word::@1/(byte*~) char_cursor#53 ) [ print_byte::b#2 char_cursor#31 ] + [59] (byte) print_byte::b#2 ← phi( print_word/(byte~) print_byte::b#4 print_word::@1/(byte~) print_byte::b#5 ) [ print_byte::b#2 char_cursor#31 ] + [60] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] + [61] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] + [62] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] + [63] (byte~) print_char::ch#3 ← (byte) print_char::ch#0 [ print_byte::b#2 char_cursor#31 print_char::ch#3 ] + [64] (byte*~) char_cursor#54 ← (byte*) char_cursor#31 [ print_byte::b#2 print_char::ch#3 char_cursor#54 ] + [65] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + [66] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] + [67] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] + [68] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] + [69] (byte~) print_char::ch#4 ← (byte) print_char::ch#1 [ char_cursor#10 print_char::ch#4 ] + [70] (byte*~) char_cursor#55 ← (byte*) char_cursor#10 [ print_char::ch#4 char_cursor#55 ] + [71] call print_char param-assignment [ char_cursor#10 ] + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + [72] return [ char_cursor#10 ] + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + [73] (byte*) char_cursor#23 ← phi( print_byte/(byte*~) char_cursor#54 print_byte::@1/(byte*~) char_cursor#55 ) [ print_char::ch#2 char_cursor#23 ] + [73] (byte) print_char::ch#2 ← phi( print_byte/(byte~) print_char::ch#3 print_byte::@1/(byte~) print_char::ch#4 ) [ print_char::ch#2 char_cursor#23 ] + [74] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] + [75] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + [76] return [ char_cursor#10 ] + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + [78] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] + [79] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + [80] return [ getFAC::return#0 ] + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + [81] phi() [ ] + [82] call prepareMEM param-assignment [ ] + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + [84] return [ ] + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + [85] (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*~) prepareMEM::mem#5 setMEMtoFAC/(byte*~) prepareMEM::mem#6 ) [ prepareMEM::mem#4 ] + [86] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] + [87] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] + [88] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] + [89] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + [90] return [ ] + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + [91] (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte[]) f_127#0 main::@5/(const byte*) f_2pi#0 ) [ mulFACbyMEM::mem#2 ] + [92] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] + [93] (byte*~) prepareMEM::mem#5 ← (byte*) prepareMEM::mem#3 [ prepareMEM::mem#5 ] + [94] call prepareMEM param-assignment [ ] + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + [96] return [ ] + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + [98] return [ ] + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + [99] phi() [ ] + [100] call prepareMEM param-assignment [ ] + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + [102] return [ ] + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + [103] (word) setFAC::w#3 ← phi( main/(byte/signed byte/word/signed word) 127 main::@1/(word~) setFAC::w#4 main::@7/(byte/signed byte/word/signed word) 25 ) [ setFAC::w#3 ] + [104] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] + [105] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] + [106] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] + [107] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + [109] return [ ] + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + [110] (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte[]) f_127#0 main::@6/(const byte[]) f_i#0 ) [ setMEMtoFAC::mem#2 ] + [111] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] + [112] (byte*~) prepareMEM::mem#6 ← (byte*) prepareMEM::mem#0 [ prepareMEM::mem#6 ] + [113] call prepareMEM param-assignment [ ] + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + [115] return [ ] + to:@return + +Created 12 initial phi equivalence classes +Coalesced [11] setFAC::w#4 ← setFAC::w#1 +Coalesced [38] main::i#14 ← main::i#1 +Not coalescing [39] char_cursor#49 ← char_cursor#1 +Coalesced [40] char_cursor#50 ← char_cursor#1 +Coalesced [41] line_cursor#31 ← line_cursor#13 +Coalesced [44] char_cursor#1 ← print_ln::$0 +Coalesced (already) [47] char_cursor#51 ← char_cursor#1 +Coalesced [50] print_byte::b#4 ← print_byte::b#0 +Coalesced [51] char_cursor#52 ← char_cursor#32 +Coalesced [55] print_byte::b#5 ← print_byte::b#1 +Coalesced [56] char_cursor#53 ← char_cursor#10 +Coalesced [63] print_char::ch#3 ← print_char::ch#0 +Coalesced [64] char_cursor#54 ← char_cursor#31 +Coalesced [69] print_char::ch#4 ← print_char::ch#1 +Coalesced (already) [70] char_cursor#55 ← char_cursor#10 +Coalesced [93] prepareMEM::mem#5 ← prepareMEM::mem#3 +Coalesced [112] prepareMEM::mem#6 ← prepareMEM::mem#0 +Coalesced down to 9 phi equivalence classes +Culled Empty Block (label) print_ln::@3 +Block Sequence Planned @begin @31 @end main main::@3 main::@1 main::@5 main::@6 main::@7 main::@8 main::@9 main::@10 main::@11 main::@12 main::@13 main::@14 main::@15 main::@return main::@16 print_ln print_ln::@1 print_ln::@return print_word print_word::@1 print_word::@return print_byte print_byte::@1 print_byte::@return print_char print_char::@return getFAC getFAC::@return addMEMtoFAC addMEMtoFAC::@1 addMEMtoFAC::@return prepareMEM prepareMEM::@return mulFACbyMEM mulFACbyMEM::@1 mulFACbyMEM::@return sinFAC sinFAC::@return divMEMbyFAC divMEMbyFAC::@1 divMEMbyFAC::@return setFAC setFAC::@return setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @31 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of main::@5 +Adding NOP phi() at start of main::@6 +Adding NOP phi() at start of main::@7 +Adding NOP phi() at start of main::@8 +Adding NOP phi() at start of main::@9 +Adding NOP phi() at start of main::@10 +Adding NOP phi() at start of main::@11 +Adding NOP phi() at start of main::@12 +Adding NOP phi() at start of main::@14 +Adding NOP phi() at start of print_ln +Adding NOP phi() at start of addMEMtoFAC +Adding NOP phi() at start of divMEMbyFAC +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +CONTROL FLOW GRAPH - BEFORE EFFECTIVE LIVE RANGES +@begin: scope:[] from + [0] phi() [ ] + to:@31 +@31: scope:[] from @begin + [1] phi() [ ] + [2] call main param-assignment [ ] + to:@end +@end: scope:[] from @31 + [3] phi() [ ] +main: scope:[main] from @31 + [4] phi() [ ] + [5] call setFAC param-assignment [ ] + to:main::@3 +main::@3: scope:[main] from main + [6] phi() [ ] + [7] call setMEMtoFAC param-assignment [ ] + to:main::@1 +main::@1: scope:[main] from main::@16 main::@3 + [8] (byte*) line_cursor#13 ← phi( main::@16/(byte*~) print_ln::$0 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] + [8] (byte*) char_cursor#32 ← phi( main::@16/(byte*~) char_cursor#49 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] + [8] (byte) main::i#10 ← phi( main::@16/(byte) main::i#1 main::@3/(byte/signed byte/word/signed word) 1 ) [ main::i#10 char_cursor#32 line_cursor#13 ] + [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] + [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] + [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@5 +main::@5: scope:[main] from main::@1 + [12] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@6 +main::@6: scope:[main] from main::@5 + [14] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@7 +main::@7: scope:[main] from main::@6 + [16] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@8 +main::@8: scope:[main] from main::@7 + [18] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@9 +main::@9: scope:[main] from main::@8 + [20] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@10 +main::@10: scope:[main] from main::@9 + [22] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@11 +main::@11: scope:[main] from main::@10 + [24] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] + to:main::@12 +main::@12: scope:[main] from main::@11 + [26] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] + [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] + [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] + to:main::@13 +main::@13: scope:[main] from main::@12 + [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] + [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] + [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] + to:main::@14 +main::@14: scope:[main] from main::@13 + [32] phi() [ main::i#10 line_cursor#13 char_cursor#10 ] + [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] + to:main::@15 +main::@15: scope:[main] from main::@14 + [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] + [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] + to:main::@return +main::@return: scope:[main] from main::@15 + [36] return [ ] + to:@return +main::@16: scope:[main] from main::@15 + [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] + to:main::@1 +print_ln: scope:[print_ln] from main::@14 + [38] phi() [ line_cursor#13 char_cursor#10 ] + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [39] (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#6 char_cursor#10 ] + [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] + [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [42] return [ print_ln::$0 ] + to:@return +print_word: scope:[print_word] from main::@13 + [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] + [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] + [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] + [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] + [48] call print_byte param-assignment [ char_cursor#10 ] + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + [49] return [ char_cursor#10 ] + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + [50] (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) [ print_byte::b#2 char_cursor#31 ] + [50] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) [ print_byte::b#2 char_cursor#31 ] + [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] + [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] + [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] + [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] + [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] + [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] + [58] call print_char param-assignment [ char_cursor#10 ] + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + [59] return [ char_cursor#10 ] + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + [60] (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) [ print_char::ch#2 char_cursor#23 ] + [60] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) [ print_char::ch#2 char_cursor#23 ] + [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] + [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + [63] return [ char_cursor#10 ] + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] + [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + [67] return [ getFAC::return#0 ] + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + [68] phi() [ ] + [69] call prepareMEM param-assignment [ ] + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + [71] return [ ] + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + [72] (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) [ prepareMEM::mem#4 ] + [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] + [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] + [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] + [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + [77] return [ ] + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + [78] (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte[]) f_127#0 main::@5/(const byte*) f_2pi#0 ) [ mulFACbyMEM::mem#2 ] + [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] + [80] call prepareMEM param-assignment [ ] + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + [82] return [ ] + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + [84] return [ ] + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + [85] phi() [ ] + [86] call prepareMEM param-assignment [ ] + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + [88] return [ ] + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + [89] (word) setFAC::w#3 ← phi( main/(byte/signed byte/word/signed word) 127 main::@1/(word) setFAC::w#1 main::@7/(byte/signed byte/word/signed word) 25 ) [ setFAC::w#3 ] + [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] + [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] + [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] + [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + [95] return [ ] + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + [96] (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte[]) f_127#0 main::@6/(const byte[]) f_i#0 ) [ setMEMtoFAC::mem#2 ] + [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] + [98] call prepareMEM param-assignment [ ] + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + [100] return [ ] + to:@return + +CONTROL FLOW GRAPH - PHI MEM COALESCED +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@31 +@31: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main param-assignment [ ] ( ) + to:@end +@end: scope:[] from @31 + [3] phi() [ ] ( ) +main: scope:[main] from @31 + [4] phi() [ ] ( main:2 [ ] ) + [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + to:main::@3 +main::@3: scope:[main] from main + [6] phi() [ ] ( main:2 [ ] ) + [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main::@16 main::@3 + [8] (byte*) line_cursor#13 ← phi( main::@16/(byte*~) print_ln::$0 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [8] (byte*) char_cursor#32 ← phi( main::@16/(byte*~) char_cursor#49 main::@3/((byte*))(word/signed word) 1024 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [8] (byte) main::i#10 ← phi( main::@16/(byte) main::i#1 main::@3/(byte/signed byte/word/signed word) 1 ) [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) + [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) + [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@5 +main::@5: scope:[main] from main::@1 + [12] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@6 +main::@6: scope:[main] from main::@5 + [14] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@7 +main::@7: scope:[main] from main::@6 + [16] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@8 +main::@8: scope:[main] from main::@7 + [18] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@9 +main::@9: scope:[main] from main::@8 + [20] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@10 +main::@10: scope:[main] from main::@9 + [22] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@11 +main::@11: scope:[main] from main::@10 + [24] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:main::@12 +main::@12: scope:[main] from main::@11 + [26] phi() [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) + to:main::@13 +main::@13: scope:[main] from main::@12 + [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) + [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) + [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:main::@14 +main::@14: scope:[main] from main::@13 + [32] phi() [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + to:main::@15 +main::@15: scope:[main] from main::@14 + [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) + [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) + to:main::@return +main::@return: scope:[main] from main::@15 + [36] return [ ] ( main:2 [ ] ) + to:@return +main::@16: scope:[main] from main::@15 + [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) + to:main::@1 +print_ln: scope:[print_ln] from main::@14 + [38] phi() [ line_cursor#13 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [39] (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*~) print_ln::$0 ) [ line_cursor#6 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 line_cursor#6 char_cursor#10 ] ) + [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) + [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + to:@return +print_word: scope:[print_word] from main::@13 + [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) + [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) + [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + to:print_word::@1 +print_word::@1: scope:[print_word] from print_word + [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) + [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) + [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_word::@return +print_word::@return: scope:[print_word] from print_word::@1 + [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:@return +print_byte: scope:[print_byte] from print_word print_word::@1 + [50] (byte*) char_cursor#31 ← phi( print_word/(byte*) char_cursor#32 print_word::@1/(byte*) char_cursor#10 ) [ print_byte::b#2 char_cursor#31 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 ] ) + [50] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 ) [ print_byte::b#2 char_cursor#31 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 ] ) + [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) + [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) + [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) + [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + to:print_byte::@1 +print_byte::@1: scope:[print_byte] from print_byte + [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) + [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) + [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) + [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte::@1 + [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:@return +print_char: scope:[print_char] from print_byte print_byte::@1 + [60] (byte*) char_cursor#23 ← phi( print_byte/(byte*) char_cursor#31 print_byte::@1/(byte*) char_cursor#10 ) [ print_char::ch#2 char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 print_char::ch#2 char_cursor#23 ] ) + [60] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 ) [ print_char::ch#2 char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 print_char::ch#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 print_char::ch#2 char_cursor#23 ] ) + [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) + [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + to:@return +getFAC: scope:[getFAC] from main::@12 + asm { jsr$b1aasty$festa$ff } + [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) + [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + to:getFAC::@return +getFAC::@return: scope:[getFAC] from getFAC + [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + to:@return +addMEMtoFAC: scope:[addMEMtoFAC] from main::@11 + [68] phi() [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:addMEMtoFAC::@1 +addMEMtoFAC::@1: scope:[addMEMtoFAC] from addMEMtoFAC + asm { lda$feldy$ffjsr$b867 } + to:addMEMtoFAC::@return +addMEMtoFAC::@return: scope:[addMEMtoFAC] from addMEMtoFAC::@1 + [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +prepareMEM: scope:[prepareMEM] from addMEMtoFAC divMEMbyFAC mulFACbyMEM setMEMtoFAC + [72] (byte*) prepareMEM::mem#4 ← phi( addMEMtoFAC/(const byte[]) f_127#0 divMEMbyFAC/(const byte[]) f_i#0 mulFACbyMEM/(byte*) prepareMEM::mem#3 setMEMtoFAC/(byte*) prepareMEM::mem#0 ) [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) + [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) + [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) + [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) + [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:prepareMEM::@return +prepareMEM::@return: scope:[prepareMEM] from prepareMEM + [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +mulFACbyMEM: scope:[mulFACbyMEM] from main::@10 main::@5 + [78] (byte*) mulFACbyMEM::mem#2 ← phi( main::@10/(const byte[]) f_127#0 main::@5/(const byte*) f_2pi#0 ) [ mulFACbyMEM::mem#2 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 mulFACbyMEM::mem#2 ] ) + [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) + [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:mulFACbyMEM::@1 +mulFACbyMEM::@1: scope:[mulFACbyMEM] from mulFACbyMEM + asm { lda$feldy$ffjsr$ba28 } + to:mulFACbyMEM::@return +mulFACbyMEM::@return: scope:[mulFACbyMEM] from mulFACbyMEM::@1 + [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +sinFAC: scope:[sinFAC] from main::@9 + asm { jsr$e26b } + to:sinFAC::@return +sinFAC::@return: scope:[sinFAC] from sinFAC + [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +divMEMbyFAC: scope:[divMEMbyFAC] from main::@8 + [85] phi() [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:divMEMbyFAC::@1 +divMEMbyFAC::@1: scope:[divMEMbyFAC] from divMEMbyFAC + asm { lda$feldy$ffjsr$bb0f } + to:divMEMbyFAC::@return +divMEMbyFAC::@return: scope:[divMEMbyFAC] from divMEMbyFAC::@1 + [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +setFAC: scope:[setFAC] from main main::@1 main::@7 + [89] (word) setFAC::w#3 ← phi( main/(byte/signed byte/word/signed word) 127 main::@1/(word) setFAC::w#1 main::@7/(byte/signed byte/word/signed word) 25 ) [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) + [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) + [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) + [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) + [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + asm { ldy$felda$ffjsr$b391 } + to:setFAC::@return +setFAC::@return: scope:[setFAC] from setFAC + [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return +setMEMtoFAC: scope:[setMEMtoFAC] from main::@3 main::@6 + [96] (byte*) setMEMtoFAC::mem#2 ← phi( main::@3/(const byte[]) f_127#0 main::@6/(const byte[]) f_i#0 ) [ setMEMtoFAC::mem#2 ] ( main:2::setMEMtoFAC:7 [ setMEMtoFAC::mem#2 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 setMEMtoFAC::mem#2 ] ) + [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) + [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:setMEMtoFAC::@1 +setMEMtoFAC::@1: scope:[setMEMtoFAC] from setMEMtoFAC + asm { ldx$feldy$ffjsr$bbd4 } + to:setMEMtoFAC::@return +setMEMtoFAC::@return: scope:[setMEMtoFAC] from setMEMtoFAC::@1 + [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + to:@return + +DOMINATORS +@begin dominated by @begin +@31 dominated by @31 @begin +@end dominated by @end @31 @begin +main dominated by main @31 @begin +main::@3 dominated by main @31 main::@3 @begin +main::@1 dominated by main main::@1 @31 main::@3 @begin +main::@5 dominated by main main::@1 main::@5 @31 main::@3 @begin +main::@6 dominated by main main::@1 main::@5 main::@6 @31 main::@3 @begin +main::@7 dominated by main::@7 main main::@1 main::@5 main::@6 @31 main::@3 @begin +main::@8 dominated by main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin +main::@9 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin +main::@10 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@10 +main::@11 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 +main::@12 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 main::@12 +main::@13 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 main::@13 main::@12 +main::@14 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 main::@13 main::@12 main::@14 +main::@15 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 +main::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@return main::@11 main::@10 main::@13 main::@12 main::@15 main::@14 +main::@16 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 main::@16 main::@13 main::@12 main::@15 main::@14 +print_ln dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@14 +print_ln::@1 dominated by main::@9 print_ln::@1 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@14 +print_ln::@return dominated by main::@9 print_ln::@1 main::@7 main::@8 main print_ln::@return main::@1 main::@5 main::@6 @31 main::@3 @begin print_ln main::@11 main::@10 main::@13 main::@12 main::@14 +print_word dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 main::@13 main::@12 +print_word::@1 dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@5 main::@6 @31 main::@3 @begin print_word::@1 main::@11 main::@10 main::@13 main::@12 +print_word::@return dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@5 main::@6 @31 main::@3 @begin print_word::@return print_word::@1 main::@11 main::@10 main::@13 main::@12 +print_byte dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 print_byte main::@13 main::@12 +print_byte::@1 dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@5 main::@6 @31 main::@3 @begin print_byte::@1 main::@11 main::@10 print_byte main::@13 main::@12 +print_byte::@return dominated by main::@9 main::@7 main::@8 main print_word main::@1 main::@5 main::@6 @31 main::@3 @begin print_byte::@return print_byte::@1 main::@11 main::@10 print_byte main::@13 main::@12 +print_char dominated by main::@9 main::@7 main::@8 main print_word print_char main::@1 main::@5 main::@6 @31 main::@3 @begin main::@11 main::@10 print_byte main::@13 main::@12 +print_char::@return dominated by main::@9 main::@7 main::@8 main print_word print_char main::@1 main::@5 main::@6 @31 main::@3 print_char::@return @begin main::@11 main::@10 print_byte main::@13 main::@12 +getFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin getFAC main::@11 main::@10 main::@12 +getFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin getFAC main::@11 main::@10 main::@12 getFAC::@return +addMEMtoFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin addMEMtoFAC main::@11 main::@10 +addMEMtoFAC::@1 dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin addMEMtoFAC::@1 addMEMtoFAC main::@11 main::@10 +addMEMtoFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin addMEMtoFAC::@1 addMEMtoFAC main::@11 main::@10 addMEMtoFAC::@return +prepareMEM dominated by main @31 main::@3 @begin prepareMEM +prepareMEM::@return dominated by main @31 main::@3 @begin prepareMEM::@return prepareMEM +mulFACbyMEM dominated by main mulFACbyMEM main::@1 main::@5 @31 main::@3 @begin +mulFACbyMEM::@1 dominated by main mulFACbyMEM main::@1 main::@5 @31 main::@3 @begin mulFACbyMEM::@1 +mulFACbyMEM::@return dominated by main mulFACbyMEM::@return mulFACbyMEM main::@1 main::@5 @31 main::@3 @begin mulFACbyMEM::@1 +sinFAC dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin sinFAC +sinFAC::@return dominated by main::@9 main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin sinFAC sinFAC::@return +divMEMbyFAC dominated by main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin divMEMbyFAC +divMEMbyFAC::@1 dominated by main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin divMEMbyFAC::@1 divMEMbyFAC +divMEMbyFAC::@return dominated by main::@7 main::@8 main main::@1 main::@5 main::@6 @31 main::@3 @begin divMEMbyFAC::@1 divMEMbyFAC divMEMbyFAC::@return +setFAC dominated by main @31 @begin setFAC +setFAC::@return dominated by setFAC::@return main @31 @begin setFAC +setMEMtoFAC dominated by main @31 main::@3 @begin setMEMtoFAC +setMEMtoFAC::@1 dominated by main @31 main::@3 @begin setMEMtoFAC setMEMtoFAC::@1 +setMEMtoFAC::@return dominated by main @31 main::@3 @begin setMEMtoFAC setMEMtoFAC::@1 setMEMtoFAC::@return + +Found back edge: Loop head: main::@1 tails: main::@16 blocks: null +Found back edge: Loop head: print_ln::@1 tails: print_ln::@1 blocks: null +Populated: Loop head: main::@1 tails: main::@16 blocks: main::@16 main::@15 main::@14 main::@13 main::@12 main::@11 main::@10 main::@9 main::@8 main::@7 main::@6 main::@5 main::@1 +Populated: Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 +NATURAL LOOPS +Loop head: main::@1 tails: main::@16 blocks: main::@16 main::@15 main::@14 main::@13 main::@12 main::@11 main::@10 main::@9 main::@8 main::@7 main::@6 main::@5 main::@1 +Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 + +Found 0 loops in scope [] +Found 1 loops in scope [main] + Loop head: main::@1 tails: main::@16 blocks: main::@16 main::@15 main::@14 main::@13 main::@12 main::@11 main::@10 main::@9 main::@8 main::@7 main::@6 main::@5 main::@1 +Found 0 loops in scope [setFAC] +Found 0 loops in scope [setMEMtoFAC] +Found 0 loops in scope [mulFACbyMEM] +Found 0 loops in scope [divMEMbyFAC] +Found 0 loops in scope [sinFAC] +Found 0 loops in scope [addMEMtoFAC] +Found 0 loops in scope [getFAC] +Found 0 loops in scope [print_word] +Found 1 loops in scope [print_ln] + Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 +Found 0 loops in scope [prepareMEM] +Found 0 loops in scope [print_byte] +Found 0 loops in scope [print_char] +NATURAL LOOPS WITH DEPTH +Loop head: main::@1 tails: main::@16 blocks: main::@16 main::@15 main::@14 main::@13 main::@12 main::@11 main::@10 main::@9 main::@8 main::@7 main::@6 main::@5 main::@1 depth: 1 +Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 depth: 2 + + +VARIABLE REGISTER WEIGHTS +(void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) +(byte*) addMEMtoFAC::mem +(byte*) char_cursor +(byte*) char_cursor#10 5.631578947368422 +(byte*) char_cursor#23 4.0 +(byte*) char_cursor#31 1.5 +(byte*) char_cursor#32 0.52 +(byte*~) char_cursor#49 22.0 +(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) +(byte*) divMEMbyFAC::mem +(byte[]) f_127 +(byte*) f_2pi +(byte[]) f_i +(word()) getFAC() +(byte*) getFAC::hi +(byte*) getFAC::lo +(word) getFAC::return +(word) getFAC::return#0 4.333333333333333 +(word) getFAC::return#2 22.0 +(word) getFAC::w +(word) getFAC::w#1 4.0 +(byte[]) hextab +(byte*) line_cursor +(byte*) line_cursor#13 0.5 +(byte*) line_cursor#6 204.0 +(void()) main() +(word~) main::$11 22.0 +(word~) main::$2 22.0 +(byte) main::i +(byte) main::i#1 11.0 +(byte) main::i#10 1.2692307692307692 +(byte*) memHi +(byte*) memLo +(void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) +(byte*) mulFACbyMEM::mem +(byte*) mulFACbyMEM::mem#2 2.0 +(void()) prepareMEM((byte*) prepareMEM::mem) +(byte~) prepareMEM::$0 4.0 +(byte~) prepareMEM::$1 4.0 +(byte*) prepareMEM::mem +(byte*) prepareMEM::mem#0 4.0 +(byte*) prepareMEM::mem#3 4.0 +(byte*) prepareMEM::mem#4 2.6666666666666665 +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 4.0 +(byte~) print_byte::$1 4.0 +(byte~) print_byte::$3 4.0 +(byte~) print_byte::$4 4.0 +(byte) print_byte::b +(byte) print_byte::b#0 4.0 +(byte) print_byte::b#1 4.0 +(byte) print_byte::b#2 1.6 +(void()) print_char((byte) print_char::ch) +(byte) print_char::ch +(byte) print_char::ch#0 4.0 +(byte) print_char::ch#1 4.0 +(byte) print_char::ch#2 6.0 +(void()) print_ln() +(byte*~) print_ln::$0 46.42857142857143 +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 4.0 +(byte~) print_word::$2 4.0 +(word) print_word::w +(word) print_word::w#0 3.75 +(void()) setFAC((word) setFAC::w) +(byte~) setFAC::$0 4.0 +(byte~) setFAC::$1 4.0 +(byte*) setFAC::hi +(byte*) setFAC::lo +(word) setFAC::w +(word) setFAC::w#1 22.0 +(word) setFAC::w#3 5.0 +(void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) +(byte*) setMEMtoFAC::mem +(byte*) setMEMtoFAC::mem#2 2.0 +(void()) sinFAC() + +Initial phi equivalence classes +[ main::i#10 main::i#1 ] +[ line_cursor#6 line_cursor#13 print_ln::$0 ] +[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +[ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +[ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +[ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] +[ mulFACbyMEM::mem#2 ] +[ setFAC::w#3 setFAC::w#1 ] +[ setMEMtoFAC::mem#2 ] +Added variable main::$2 to zero page equivalence class [ main::$2 ] +Added variable getFAC::return#2 to zero page equivalence class [ getFAC::return#2 ] +Added variable main::$11 to zero page equivalence class [ main::$11 ] +Added variable print_word::w#0 to zero page equivalence class [ print_word::w#0 ] +Added variable print_word::$0 to zero page equivalence class [ print_word::$0 ] +Added variable print_word::$2 to zero page equivalence class [ print_word::$2 ] +Added variable print_byte::$0 to zero page equivalence class [ print_byte::$0 ] +Added variable print_byte::$1 to zero page equivalence class [ print_byte::$1 ] +Added variable print_byte::$3 to zero page equivalence class [ print_byte::$3 ] +Added variable print_byte::$4 to zero page equivalence class [ print_byte::$4 ] +Added variable getFAC::w#1 to zero page equivalence class [ getFAC::w#1 ] +Added variable getFAC::return#0 to zero page equivalence class [ getFAC::return#0 ] +Added variable prepareMEM::$0 to zero page equivalence class [ prepareMEM::$0 ] +Added variable prepareMEM::$1 to zero page equivalence class [ prepareMEM::$1 ] +Added variable setFAC::$0 to zero page equivalence class [ setFAC::$0 ] +Added variable setFAC::$1 to zero page equivalence class [ setFAC::$1 ] +Complete equivalence classes +[ main::i#10 main::i#1 ] +[ line_cursor#6 line_cursor#13 print_ln::$0 ] +[ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +[ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +[ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +[ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] +[ mulFACbyMEM::mem#2 ] +[ setFAC::w#3 setFAC::w#1 ] +[ setMEMtoFAC::mem#2 ] +[ main::$2 ] +[ getFAC::return#2 ] +[ main::$11 ] +[ print_word::w#0 ] +[ print_word::$0 ] +[ print_word::$2 ] +[ print_byte::$0 ] +[ print_byte::$1 ] +[ print_byte::$3 ] +[ print_byte::$4 ] +[ getFAC::w#1 ] +[ getFAC::return#0 ] +[ prepareMEM::$0 ] +[ prepareMEM::$1 ] +[ setFAC::$0 ] +[ setFAC::$1 ] +Allocated zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Allocated zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ] +Allocated zp ZP_BYTE:5 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Allocated zp ZP_BYTE:6 [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +Allocated zp ZP_PTR_BYTE:7 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +Allocated zp ZP_PTR_BYTE:9 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] +Allocated zp ZP_PTR_BYTE:11 [ mulFACbyMEM::mem#2 ] +Allocated zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 ] +Allocated zp ZP_PTR_BYTE:15 [ setMEMtoFAC::mem#2 ] +Allocated zp ZP_WORD:17 [ main::$2 ] +Allocated zp ZP_WORD:19 [ getFAC::return#2 ] +Allocated zp ZP_WORD:21 [ main::$11 ] +Allocated zp ZP_WORD:23 [ print_word::w#0 ] +Allocated zp ZP_BYTE:25 [ print_word::$0 ] +Allocated zp ZP_BYTE:26 [ print_word::$2 ] +Allocated zp ZP_BYTE:27 [ print_byte::$0 ] +Allocated zp ZP_BYTE:28 [ print_byte::$1 ] +Allocated zp ZP_BYTE:29 [ print_byte::$3 ] +Allocated zp ZP_BYTE:30 [ print_byte::$4 ] +Allocated zp ZP_WORD:31 [ getFAC::w#1 ] +Allocated zp ZP_WORD:33 [ getFAC::return#0 ] +Allocated zp ZP_BYTE:35 [ prepareMEM::$0 ] +Allocated zp ZP_BYTE:36 [ prepareMEM::$1 ] +Allocated zp ZP_BYTE:37 [ setFAC::$0 ] +Allocated zp ZP_BYTE:38 [ setFAC::$1 ] +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .const memLo = $fe + .const memHi = $ff + .const f_2pi = $e2e5 + .label char_cursor = 7 + .label line_cursor = 3 + hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + f_i: .byte 0, 0, 0, 0, 0 + f_127: .byte 0, 0, 0, 0, 0 +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @31 [phi:@begin->@31] +b31_from_bbegin: + jmp b31 +//SEG4 @31 +b31: +//SEG5 [2] call main param-assignment [ ] ( ) +//SEG6 [4] phi from @31 to main [phi:@31->main] +main_from_b31: + jsr main +//SEG7 [3] phi from @31 to @end [phi:@31->@end] +bend_from_b31: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label _2 = $11 + .label _11 = $15 + .label i = 2 + //SEG10 [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + //SEG11 [89] phi from main to setFAC [phi:main->setFAC] + setFAC_from_main: + //SEG12 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 127 [phi:main->setFAC#0] -- zpwo1=coby1 + lda #$7f + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG13 [6] phi from main to main::@3 [phi:main->main::@3] + b3_from_main: + jmp b3 + //SEG14 main::@3 + b3: + //SEG15 [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + //SEG16 [96] phi from main::@3 to setMEMtoFAC [phi:main::@3->setMEMtoFAC] + setMEMtoFAC_from_b3: + //SEG17 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_127#0 [phi:main::@3->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_127 + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG18 [8] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + //SEG19 [8] phi (byte*) line_cursor#13 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#0] -- zpptrby1=cowo1 + lda #<$400 + sta line_cursor + lda #>$400 + sta line_cursor+1 + //SEG20 [8] phi (byte*) char_cursor#32 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#1] -- zpptrby1=cowo1 + lda #<$400 + sta char_cursor + lda #>$400 + sta char_cursor+1 + //SEG21 [8] phi (byte) main::i#10 = (byte/signed byte/word/signed word) 1 [phi:main::@3->main::@1#2] -- zpby1=coby1 + lda #1 + sta i + jmp b1 + //SEG22 main::@1 + b1: + //SEG23 [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) -- zpwo1=_word_zpby1 + lda i + sta _2 + lda #0 + sta _2+1 + //SEG24 [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) -- zpwo1=zpwo2 + lda _2 + sta setFAC.w + lda _2+1 + sta setFAC.w+1 + //SEG25 [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG26 [89] phi from main::@1 to setFAC [phi:main::@1->setFAC] + setFAC_from_b1: + //SEG27 [89] phi (word) setFAC::w#3 = (word) setFAC::w#1 [phi:main::@1->setFAC#0] -- register_copy + jsr setFAC + //SEG28 [12] phi from main::@1 to main::@5 [phi:main::@1->main::@5] + b5_from_b1: + jmp b5 + //SEG29 main::@5 + b5: + //SEG30 [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG31 [78] phi from main::@5 to mulFACbyMEM [phi:main::@5->mulFACbyMEM] + mulFACbyMEM_from_b5: + //SEG32 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) f_2pi#0 [phi:main::@5->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_2pi + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG33 [14] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + b6_from_b5: + jmp b6 + //SEG34 main::@6 + b6: + //SEG35 [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG36 [96] phi from main::@6 to setMEMtoFAC [phi:main::@6->setMEMtoFAC] + setMEMtoFAC_from_b6: + //SEG37 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_i#0 [phi:main::@6->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_i + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG38 [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7] + b7_from_b6: + jmp b7 + //SEG39 main::@7 + b7: + //SEG40 [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG41 [89] phi from main::@7 to setFAC [phi:main::@7->setFAC] + setFAC_from_b7: + //SEG42 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 25 [phi:main::@7->setFAC#0] -- zpwo1=coby1 + lda #$19 + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG43 [18] phi from main::@7 to main::@8 [phi:main::@7->main::@8] + b8_from_b7: + jmp b8 + //SEG44 main::@8 + b8: + //SEG45 [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG46 [85] phi from main::@8 to divMEMbyFAC [phi:main::@8->divMEMbyFAC] + divMEMbyFAC_from_b8: + jsr divMEMbyFAC + //SEG47 [20] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + b9_from_b8: + jmp b9 + //SEG48 main::@9 + b9: + //SEG49 [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + jsr sinFAC + //SEG50 [22] phi from main::@9 to main::@10 [phi:main::@9->main::@10] + b10_from_b9: + jmp b10 + //SEG51 main::@10 + b10: + //SEG52 [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG53 [78] phi from main::@10 to mulFACbyMEM [phi:main::@10->mulFACbyMEM] + mulFACbyMEM_from_b10: + //SEG54 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte[]) f_127#0 [phi:main::@10->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG55 [24] phi from main::@10 to main::@11 [phi:main::@10->main::@11] + b11_from_b10: + jmp b11 + //SEG56 main::@11 + b11: + //SEG57 [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG58 [68] phi from main::@11 to addMEMtoFAC [phi:main::@11->addMEMtoFAC] + addMEMtoFAC_from_b11: + jsr addMEMtoFAC + //SEG59 [26] phi from main::@11 to main::@12 [phi:main::@11->main::@12] + b12_from_b11: + jmp b12 + //SEG60 main::@12 + b12: + //SEG61 [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + jsr getFAC + //SEG62 [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) -- zpwo1=zpwo2 + lda getFAC.return + sta getFAC.return_2 + lda getFAC.return+1 + sta getFAC.return_2+1 + jmp b13 + //SEG63 main::@13 + b13: + //SEG64 [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) -- zpwo1=zpwo2 + lda getFAC.return_2 + sta _11 + lda getFAC.return_2+1 + sta _11+1 + //SEG65 [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) -- zpwo1=zpwo2 + lda _11 + sta print_word.w + lda _11+1 + sta print_word.w+1 + //SEG66 [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + jsr print_word + //SEG67 [32] phi from main::@13 to main::@14 [phi:main::@13->main::@14] + b14_from_b13: + jmp b14 + //SEG68 main::@14 + b14: + //SEG69 [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + //SEG70 [38] phi from main::@14 to print_ln [phi:main::@14->print_ln] + print_ln_from_b14: + jsr print_ln + jmp b15 + //SEG71 main::@15 + b15: + //SEG72 [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1=_inc_zpby1 + inc i + //SEG73 [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1_neq_coby1_then_la1 + lda i + cmp #$1a + bne b16 + jmp breturn + //SEG74 main::@return + breturn: + //SEG75 [36] return [ ] ( main:2 [ ] ) + rts + //SEG76 main::@16 + b16: + //SEG77 [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + lda print_ln._0 + sta char_cursor + lda print_ln._0+1 + sta char_cursor+1 + //SEG78 [8] phi from main::@16 to main::@1 [phi:main::@16->main::@1] + b1_from_b16: + //SEG79 [8] phi (byte*) line_cursor#13 = (byte*~) print_ln::$0 [phi:main::@16->main::@1#0] -- register_copy + //SEG80 [8] phi (byte*) char_cursor#32 = (byte*~) char_cursor#49 [phi:main::@16->main::@1#1] -- register_copy + //SEG81 [8] phi (byte) main::i#10 = (byte) main::i#1 [phi:main::@16->main::@1#2] -- register_copy + jmp b1 +} +//SEG82 print_ln +print_ln: { + .label _0 = 3 + //SEG83 [39] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + b1_from_print_ln: + b1_from_b1: + //SEG84 [39] phi (byte*) line_cursor#6 = (byte*) line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + jmp b1 + //SEG85 print_ln::@1 + b1: + //SEG86 [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1=zpptrby1_plus_coby1 + lda _0 + clc + adc #$28 + sta _0 + bcc !+ + inc _0+1 + !: + //SEG87 [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + lda _0+1 + cmp char_cursor+1 + bcc b1_from_b1 + bne !+ + lda _0 + cmp char_cursor + bcc b1_from_b1 + !: + jmp breturn + //SEG88 print_ln::@return + breturn: + //SEG89 [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + rts +} +//SEG90 print_word +print_word: { + .label _0 = $19 + .label _2 = $1a + .label w = $17 + //SEG91 [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) -- zpby1=_hi_zpwo1 + lda w+1 + sta _0 + //SEG92 [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) -- zpby1=zpby2 + lda _0 + sta print_byte.b + //SEG93 [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + //SEG94 [50] phi from print_word to print_byte [phi:print_word->print_byte] + print_byte_from_print_word: + //SEG95 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#32 [phi:print_word->print_byte#0] -- register_copy + //SEG96 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy + jsr print_byte + jmp b1 + //SEG97 print_word::@1 + b1: + //SEG98 [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) -- zpby1=_lo_zpwo1 + lda w + sta _2 + //SEG99 [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) -- zpby1=zpby2 + lda _2 + sta print_byte.b + //SEG100 [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG101 [50] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte] + print_byte_from_b1: + //SEG102 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#10 [phi:print_word::@1->print_byte#0] -- register_copy + //SEG103 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy + jsr print_byte + jmp breturn + //SEG104 print_word::@return + breturn: + //SEG105 [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG106 print_byte +print_byte: { + .label _0 = $1b + .label _1 = $1c + .label _3 = $1d + .label _4 = $1e + .label b = 5 + //SEG107 [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) -- zpby1=zpby2_ror_4 + lda b + lsr + lsr + lsr + lsr + sta _0 + //SEG108 [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) -- zpby1=cowo1_derefidx_zpby2 + ldx _0 + lda hextab,x + sta _1 + //SEG109 [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) -- zpby1=zpby2 + lda _1 + sta print_char.ch + //SEG110 [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + //SEG111 [60] phi from print_byte to print_char [phi:print_byte->print_char] + print_char_from_print_byte: + //SEG112 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#31 [phi:print_byte->print_char#0] -- register_copy + //SEG113 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + jmp b1 + //SEG114 print_byte::@1 + b1: + //SEG115 [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) -- zpby1=zpby2_band_coby1 + lda b + and #$f + sta _3 + //SEG116 [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) -- zpby1=cowo1_derefidx_zpby2 + ldx _3 + lda hextab,x + sta _4 + //SEG117 [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) -- zpby1=zpby2 + lda _4 + sta print_char.ch + //SEG118 [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG119 [60] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + print_char_from_b1: + //SEG120 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy + //SEG121 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + jmp breturn + //SEG122 print_byte::@return + breturn: + //SEG123 [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG124 print_char +print_char: { + .label ch = 6 + //SEG125 [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) -- _deref_zpptrby1=zpby1 + ldy #0 + lda ch + sta (char_cursor),y + //SEG126 [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) -- zpptrby1=_inc_zpptrby1 + inc char_cursor + bne !+ + inc char_cursor+1 + !: + jmp breturn + //SEG127 print_char::@return + breturn: + //SEG128 [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG129 getFAC +getFAC: { + .const lo = $fe + .const hi = $ff + .label w = $1f + .label return = $21 + .label return_2 = $13 + //SEG130 asm { jsr$b1aasty$festa$ff } + jsr $b1aa + sty $fe + sta $ff + //SEG131 [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) -- zpwo1=coby1_setlo__deref_cowo2 + lda lo + sta w + lda #0 + sta w+1 + //SEG132 [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) -- zpwo1=zpwo2_sethi__deref_cowo1 + lda hi + sta return+1 + lda w + sta return + jmp breturn + //SEG133 getFAC::@return + breturn: + //SEG134 [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + rts +} +//SEG135 addMEMtoFAC +addMEMtoFAC: { + //SEG136 [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG137 [72] phi from addMEMtoFAC to prepareMEM [phi:addMEMtoFAC->prepareMEM] + prepareMEM_from_addMEMtoFAC: + //SEG138 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_127#0 [phi:addMEMtoFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta prepareMEM.mem+1 + jsr prepareMEM + jmp b1 + //SEG139 addMEMtoFAC::@1 + b1: + //SEG140 asm { lda$feldy$ffjsr$b867 } + lda $fe + ldy $ff + jsr $b867 + jmp breturn + //SEG141 addMEMtoFAC::@return + breturn: + //SEG142 [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG143 prepareMEM +prepareMEM: { + .label _0 = $23 + .label _1 = $24 + .label mem = 9 + //SEG144 [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) -- zpby1=_lo_zpptrby1 + lda mem + sta _0 + //SEG145 [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) -- _deref_cowo1=zpby1 + lda _0 + sta memLo + //SEG146 [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) -- zpby1=_hi_zpptrby1 + lda mem+1 + sta _1 + //SEG147 [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=zpby1 + lda _1 + sta memHi + jmp breturn + //SEG148 prepareMEM::@return + breturn: + //SEG149 [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG150 mulFACbyMEM +mulFACbyMEM: { + .label mem = $b + //SEG151 [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) -- zpptrby1=zpptrby2 + lda mem + sta prepareMEM.mem + lda mem+1 + sta prepareMEM.mem+1 + //SEG152 [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG153 [72] phi from mulFACbyMEM to prepareMEM [phi:mulFACbyMEM->prepareMEM] + prepareMEM_from_mulFACbyMEM: + //SEG154 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#3 [phi:mulFACbyMEM->prepareMEM#0] -- register_copy + jsr prepareMEM + jmp b1 + //SEG155 mulFACbyMEM::@1 + b1: + //SEG156 asm { lda$feldy$ffjsr$ba28 } + lda $fe + ldy $ff + jsr $ba28 + jmp breturn + //SEG157 mulFACbyMEM::@return + breturn: + //SEG158 [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG159 sinFAC +sinFAC: { + //SEG160 asm { jsr$e26b } + jsr $e26b + jmp breturn + //SEG161 sinFAC::@return + breturn: + //SEG162 [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG163 divMEMbyFAC +divMEMbyFAC: { + //SEG164 [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG165 [72] phi from divMEMbyFAC to prepareMEM [phi:divMEMbyFAC->prepareMEM] + prepareMEM_from_divMEMbyFAC: + //SEG166 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_i#0 [phi:divMEMbyFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_i + sta prepareMEM.mem+1 + jsr prepareMEM + jmp b1 + //SEG167 divMEMbyFAC::@1 + b1: + //SEG168 asm { lda$feldy$ffjsr$bb0f } + lda $fe + ldy $ff + jsr $bb0f + jmp breturn + //SEG169 divMEMbyFAC::@return + breturn: + //SEG170 [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG171 setFAC +setFAC: { + .const lo = $fe + .const hi = $ff + .label _0 = $25 + .label _1 = $26 + .label w = $d + //SEG172 [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) -- zpby1=_lo_zpwo1 + lda w + sta _0 + //SEG173 [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) -- _deref_cowo1=zpby1 + lda _0 + sta lo + //SEG174 [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) -- zpby1=_hi_zpwo1 + lda w+1 + sta _1 + //SEG175 [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=zpby1 + lda _1 + sta hi + //SEG176 asm { ldy$felda$ffjsr$b391 } + ldy $fe + lda $ff + jsr $b391 + jmp breturn + //SEG177 setFAC::@return + breturn: + //SEG178 [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG179 setMEMtoFAC +setMEMtoFAC: { + .label mem = $f + //SEG180 [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) -- zpptrby1=zpptrby2 + lda mem + sta prepareMEM.mem + lda mem+1 + sta prepareMEM.mem+1 + //SEG181 [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG182 [72] phi from setMEMtoFAC to prepareMEM [phi:setMEMtoFAC->prepareMEM] + prepareMEM_from_setMEMtoFAC: + //SEG183 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#0 [phi:setMEMtoFAC->prepareMEM#0] -- register_copy + jsr prepareMEM + jmp b1 + //SEG184 setMEMtoFAC::@1 + b1: + //SEG185 asm { ldx$feldy$ffjsr$bbd4 } + ldx $fe + ldy $ff + jsr $bbd4 + jmp breturn + //SEG186 setMEMtoFAC::@return + breturn: + //SEG187 [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} + +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Statement [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) always clobbers reg byte a +Statement [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) always clobbers reg byte a +Statement [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) always clobbers reg byte a +Statement [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) always clobbers reg byte a +Statement [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) always clobbers reg byte a +Statement [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) always clobbers reg byte a +Statement [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) always clobbers reg byte a +Statement [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) always clobbers reg byte a +Statement [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) always clobbers reg byte a +Statement [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) always clobbers reg byte a +Statement [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Statement [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) always clobbers reg byte a +Statement [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) always clobbers reg byte a +Statement asm { lda$feldy$ffjsr$b867 } always clobbers reg byte a reg byte y +Statement [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) always clobbers reg byte a +Statement [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) always clobbers reg byte a +Statement [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) always clobbers reg byte a +Statement asm { lda$feldy$ffjsr$ba28 } always clobbers reg byte a reg byte y +Statement asm { lda$feldy$ffjsr$bb0f } always clobbers reg byte a reg byte y +Statement [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) always clobbers reg byte a +Statement [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) always clobbers reg byte a +Statement asm { ldy$felda$ffjsr$b391 } always clobbers reg byte a reg byte y +Statement [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) always clobbers reg byte a +Statement asm { ldx$feldy$ffjsr$bbd4 } always clobbers reg byte x reg byte y +Removing always clobbered register reg byte x as potential for zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Statement [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) always clobbers reg byte a +Statement [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) always clobbers reg byte a +Statement [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) always clobbers reg byte a +Statement [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) always clobbers reg byte a +Statement [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) always clobbers reg byte a +Statement [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) always clobbers reg byte a +Statement [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) always clobbers reg byte a +Statement [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) always clobbers reg byte a +Statement [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) always clobbers reg byte a +Statement [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) always clobbers reg byte a +Statement [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) always clobbers reg byte a +Statement [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) always clobbers reg byte a +Statement [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) always clobbers reg byte y +Statement [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) always clobbers reg byte a +Statement [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) always clobbers reg byte a +Statement asm { lda$feldy$ffjsr$b867 } always clobbers reg byte a reg byte y +Statement [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) always clobbers reg byte a +Statement [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) always clobbers reg byte a +Statement [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) always clobbers reg byte a +Statement asm { lda$feldy$ffjsr$ba28 } always clobbers reg byte a reg byte y +Statement asm { lda$feldy$ffjsr$bb0f } always clobbers reg byte a reg byte y +Statement [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) always clobbers reg byte a +Statement [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) always clobbers reg byte a +Statement asm { ldy$felda$ffjsr$b391 } always clobbers reg byte a reg byte y +Statement [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) always clobbers reg byte a +Statement asm { ldx$feldy$ffjsr$bbd4 } always clobbers reg byte x reg byte y +Potential registers zp ZP_BYTE:2 [ main::i#10 main::i#1 ] : zp ZP_BYTE:2 , +Potential registers zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ] : zp ZP_PTR_BYTE:3 , +Potential registers zp ZP_BYTE:5 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , +Potential registers zp ZP_BYTE:6 [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_PTR_BYTE:7 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] : zp ZP_PTR_BYTE:7 , +Potential registers zp ZP_PTR_BYTE:9 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] : zp ZP_PTR_BYTE:9 , +Potential registers zp ZP_PTR_BYTE:11 [ mulFACbyMEM::mem#2 ] : zp ZP_PTR_BYTE:11 , +Potential registers zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 ] : zp ZP_WORD:13 , +Potential registers zp ZP_PTR_BYTE:15 [ setMEMtoFAC::mem#2 ] : zp ZP_PTR_BYTE:15 , +Potential registers zp ZP_WORD:17 [ main::$2 ] : zp ZP_WORD:17 , +Potential registers zp ZP_WORD:19 [ getFAC::return#2 ] : zp ZP_WORD:19 , +Potential registers zp ZP_WORD:21 [ main::$11 ] : zp ZP_WORD:21 , +Potential registers zp ZP_WORD:23 [ print_word::w#0 ] : zp ZP_WORD:23 , +Potential registers zp ZP_BYTE:25 [ print_word::$0 ] : zp ZP_BYTE:25 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:26 [ print_word::$2 ] : zp ZP_BYTE:26 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:27 [ print_byte::$0 ] : zp ZP_BYTE:27 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:28 [ print_byte::$1 ] : zp ZP_BYTE:28 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:29 [ print_byte::$3 ] : zp ZP_BYTE:29 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:30 [ print_byte::$4 ] : zp ZP_BYTE:30 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:31 [ getFAC::w#1 ] : zp ZP_WORD:31 , +Potential registers zp ZP_WORD:33 [ getFAC::return#0 ] : zp ZP_WORD:33 , +Potential registers zp ZP_BYTE:35 [ prepareMEM::$0 ] : zp ZP_BYTE:35 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:36 [ prepareMEM::$1 ] : zp ZP_BYTE:36 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:37 [ setFAC::$0 ] : zp ZP_BYTE:37 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:38 [ setFAC::$1 ] : zp ZP_BYTE:38 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [] 250.93: zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ] 33.65: zp ZP_PTR_BYTE:7 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +Uplift Scope [main] 22: zp ZP_WORD:17 [ main::$2 ] 22: zp ZP_WORD:21 [ main::$11 ] 12.27: zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Uplift Scope [setFAC] 27: zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 ] 4: zp ZP_BYTE:37 [ setFAC::$0 ] 4: zp ZP_BYTE:38 [ setFAC::$1 ] +Uplift Scope [getFAC] 22: zp ZP_WORD:19 [ getFAC::return#2 ] 4.33: zp ZP_WORD:33 [ getFAC::return#0 ] 4: zp ZP_WORD:31 [ getFAC::w#1 ] +Uplift Scope [print_byte] 9.6: zp ZP_BYTE:5 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] 4: zp ZP_BYTE:27 [ print_byte::$0 ] 4: zp ZP_BYTE:28 [ print_byte::$1 ] 4: zp ZP_BYTE:29 [ print_byte::$3 ] 4: zp ZP_BYTE:30 [ print_byte::$4 ] +Uplift Scope [prepareMEM] 10.67: zp ZP_PTR_BYTE:9 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] 4: zp ZP_BYTE:35 [ prepareMEM::$0 ] 4: zp ZP_BYTE:36 [ prepareMEM::$1 ] +Uplift Scope [print_char] 14: zp ZP_BYTE:6 [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +Uplift Scope [print_word] 4: zp ZP_BYTE:25 [ print_word::$0 ] 4: zp ZP_BYTE:26 [ print_word::$2 ] 3.75: zp ZP_WORD:23 [ print_word::w#0 ] +Uplift Scope [setMEMtoFAC] 2: zp ZP_PTR_BYTE:15 [ setMEMtoFAC::mem#2 ] +Uplift Scope [mulFACbyMEM] 2: zp ZP_PTR_BYTE:11 [ mulFACbyMEM::mem#2 ] +Uplift Scope [print_ln] +Uplift Scope [addMEMtoFAC] +Uplift Scope [divMEMbyFAC] +Uplift Scope [sinFAC] + +Uplifting [] best 7030 combination zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ] zp ZP_PTR_BYTE:7 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +Uplifting [main] best 7030 combination zp ZP_WORD:17 [ main::$2 ] zp ZP_WORD:21 [ main::$11 ] zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Uplifting [setFAC] best 7018 combination zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 ] reg byte a [ setFAC::$0 ] reg byte a [ setFAC::$1 ] +Uplifting [getFAC] best 7018 combination zp ZP_WORD:19 [ getFAC::return#2 ] zp ZP_WORD:33 [ getFAC::return#0 ] zp ZP_WORD:31 [ getFAC::w#1 ] +Uplifting [print_byte] best 6990 combination reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte y [ print_byte::$0 ] reg byte a [ print_byte::$1 ] reg byte a [ print_byte::$3 ] reg byte a [ print_byte::$4 ] +Uplifting [prepareMEM] best 6978 combination zp ZP_PTR_BYTE:9 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] reg byte a [ prepareMEM::$0 ] reg byte a [ prepareMEM::$1 ] +Uplifting [print_char] best 6969 combination reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +Uplifting [print_word] best 6961 combination reg byte a [ print_word::$0 ] reg byte a [ print_word::$2 ] zp ZP_WORD:23 [ print_word::w#0 ] +Uplifting [setMEMtoFAC] best 6961 combination zp ZP_PTR_BYTE:15 [ setMEMtoFAC::mem#2 ] +Uplifting [mulFACbyMEM] best 6961 combination zp ZP_PTR_BYTE:11 [ mulFACbyMEM::mem#2 ] +Uplifting [print_ln] best 6961 combination +Uplifting [addMEMtoFAC] best 6961 combination +Uplifting [divMEMbyFAC] best 6961 combination +Uplifting [sinFAC] best 6961 combination +Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Uplifting [main] best 6961 combination zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +Coalescing zero page register [ zp ZP_PTR_BYTE:9 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 ] ] with [ zp ZP_PTR_BYTE:11 [ mulFACbyMEM::mem#2 ] ] +Coalescing zero page register [ zp ZP_PTR_BYTE:9 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 mulFACbyMEM::mem#2 ] ] with [ zp ZP_PTR_BYTE:15 [ setMEMtoFAC::mem#2 ] ] +Coalescing zero page register [ zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 ] ] with [ zp ZP_WORD:17 [ main::$2 ] ] +Coalescing zero page register [ zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 main::$2 ] ] with [ zp ZP_WORD:19 [ getFAC::return#2 ] ] +Coalescing zero page register [ zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 ] ] with [ zp ZP_WORD:21 [ main::$11 ] ] +Coalescing zero page register [ zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 main::$11 ] ] with [ zp ZP_WORD:23 [ print_word::w#0 ] ] +Coalescing zero page register [ zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 main::$11 print_word::w#0 ] ] with [ zp ZP_WORD:31 [ getFAC::w#1 ] ] +Coalescing zero page register [ zp ZP_WORD:13 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 main::$11 print_word::w#0 getFAC::w#1 ] ] with [ zp ZP_WORD:33 [ getFAC::return#0 ] ] +Allocated (was zp ZP_PTR_BYTE:7) zp ZP_PTR_BYTE:5 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +Allocated (was zp ZP_PTR_BYTE:9) zp ZP_PTR_BYTE:7 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 mulFACbyMEM::mem#2 setMEMtoFAC::mem#2 ] +Allocated (was zp ZP_WORD:13) zp ZP_WORD:9 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 main::$11 print_word::w#0 getFAC::w#1 getFAC::return#0 ] +Removing instruction jmp b31 +Removing instruction jmp bend +Removing instruction jmp b3 +Removing instruction jmp b1 +Removing instruction jmp b5 +Removing instruction jmp b6 +Removing instruction jmp b7 +Removing instruction jmp b8 +Removing instruction jmp b9 +Removing instruction jmp b10 +Removing instruction jmp b11 +Removing instruction jmp b12 +Removing instruction jmp b13 +Removing instruction jmp b14 +Removing instruction jmp b15 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp breturn +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +ASSEMBLER +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .const memLo = $fe + .const memHi = $ff + .const f_2pi = $e2e5 + .label char_cursor = 5 + .label line_cursor = 3 + hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + f_i: .byte 0, 0, 0, 0, 0 + f_127: .byte 0, 0, 0, 0, 0 +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @31 [phi:@begin->@31] +b31_from_bbegin: +//SEG4 @31 +b31: +//SEG5 [2] call main param-assignment [ ] ( ) +//SEG6 [4] phi from @31 to main [phi:@31->main] +main_from_b31: + jsr main +//SEG7 [3] phi from @31 to @end [phi:@31->@end] +bend_from_b31: +//SEG8 @end +bend: +//SEG9 main +main: { + .label _2 = 9 + .label _11 = 9 + .label i = 2 + //SEG10 [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + //SEG11 [89] phi from main to setFAC [phi:main->setFAC] + setFAC_from_main: + //SEG12 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 127 [phi:main->setFAC#0] -- zpwo1=coby1 + lda #$7f + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG13 [6] phi from main to main::@3 [phi:main->main::@3] + b3_from_main: + //SEG14 main::@3 + b3: + //SEG15 [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + //SEG16 [96] phi from main::@3 to setMEMtoFAC [phi:main::@3->setMEMtoFAC] + setMEMtoFAC_from_b3: + //SEG17 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_127#0 [phi:main::@3->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_127 + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG18 [8] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + //SEG19 [8] phi (byte*) line_cursor#13 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#0] -- zpptrby1=cowo1 + lda #<$400 + sta line_cursor + lda #>$400 + sta line_cursor+1 + //SEG20 [8] phi (byte*) char_cursor#32 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#1] -- zpptrby1=cowo1 + lda #<$400 + sta char_cursor + lda #>$400 + sta char_cursor+1 + //SEG21 [8] phi (byte) main::i#10 = (byte/signed byte/word/signed word) 1 [phi:main::@3->main::@1#2] -- zpby1=coby1 + lda #1 + sta i + //SEG22 main::@1 + b1: + //SEG23 [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) -- zpwo1=_word_zpby1 + lda i + sta _2 + lda #0 + sta _2+1 + //SEG24 [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) + // (word) setFAC::w#1 = (word~) main::$2 // register copy zp ZP_WORD:9 + //SEG25 [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG26 [89] phi from main::@1 to setFAC [phi:main::@1->setFAC] + setFAC_from_b1: + //SEG27 [89] phi (word) setFAC::w#3 = (word) setFAC::w#1 [phi:main::@1->setFAC#0] -- register_copy + jsr setFAC + //SEG28 [12] phi from main::@1 to main::@5 [phi:main::@1->main::@5] + b5_from_b1: + //SEG29 main::@5 + b5: + //SEG30 [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG31 [78] phi from main::@5 to mulFACbyMEM [phi:main::@5->mulFACbyMEM] + mulFACbyMEM_from_b5: + //SEG32 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) f_2pi#0 [phi:main::@5->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_2pi + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG33 [14] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + b6_from_b5: + //SEG34 main::@6 + b6: + //SEG35 [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG36 [96] phi from main::@6 to setMEMtoFAC [phi:main::@6->setMEMtoFAC] + setMEMtoFAC_from_b6: + //SEG37 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_i#0 [phi:main::@6->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_i + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG38 [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7] + b7_from_b6: + //SEG39 main::@7 + b7: + //SEG40 [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG41 [89] phi from main::@7 to setFAC [phi:main::@7->setFAC] + setFAC_from_b7: + //SEG42 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 25 [phi:main::@7->setFAC#0] -- zpwo1=coby1 + lda #$19 + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG43 [18] phi from main::@7 to main::@8 [phi:main::@7->main::@8] + b8_from_b7: + //SEG44 main::@8 + b8: + //SEG45 [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG46 [85] phi from main::@8 to divMEMbyFAC [phi:main::@8->divMEMbyFAC] + divMEMbyFAC_from_b8: + jsr divMEMbyFAC + //SEG47 [20] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + b9_from_b8: + //SEG48 main::@9 + b9: + //SEG49 [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + jsr sinFAC + //SEG50 [22] phi from main::@9 to main::@10 [phi:main::@9->main::@10] + b10_from_b9: + //SEG51 main::@10 + b10: + //SEG52 [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG53 [78] phi from main::@10 to mulFACbyMEM [phi:main::@10->mulFACbyMEM] + mulFACbyMEM_from_b10: + //SEG54 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte[]) f_127#0 [phi:main::@10->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG55 [24] phi from main::@10 to main::@11 [phi:main::@10->main::@11] + b11_from_b10: + //SEG56 main::@11 + b11: + //SEG57 [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG58 [68] phi from main::@11 to addMEMtoFAC [phi:main::@11->addMEMtoFAC] + addMEMtoFAC_from_b11: + jsr addMEMtoFAC + //SEG59 [26] phi from main::@11 to main::@12 [phi:main::@11->main::@12] + b12_from_b11: + //SEG60 main::@12 + b12: + //SEG61 [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + jsr getFAC + //SEG62 [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) + // (word) getFAC::return#2 = (word) getFAC::return#0 // register copy zp ZP_WORD:9 + //SEG63 main::@13 + b13: + //SEG64 [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) + // (word~) main::$11 = (word) getFAC::return#2 // register copy zp ZP_WORD:9 + //SEG65 [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) + // (word) print_word::w#0 = (word~) main::$11 // register copy zp ZP_WORD:9 + //SEG66 [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + jsr print_word + //SEG67 [32] phi from main::@13 to main::@14 [phi:main::@13->main::@14] + b14_from_b13: + //SEG68 main::@14 + b14: + //SEG69 [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + //SEG70 [38] phi from main::@14 to print_ln [phi:main::@14->print_ln] + print_ln_from_b14: + jsr print_ln + //SEG71 main::@15 + b15: + //SEG72 [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1=_inc_zpby1 + inc i + //SEG73 [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1_neq_coby1_then_la1 + lda i + cmp #$1a + bne b16 + //SEG74 main::@return + breturn: + //SEG75 [36] return [ ] ( main:2 [ ] ) + rts + //SEG76 main::@16 + b16: + //SEG77 [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + lda print_ln._0 + sta char_cursor + lda print_ln._0+1 + sta char_cursor+1 + //SEG78 [8] phi from main::@16 to main::@1 [phi:main::@16->main::@1] + b1_from_b16: + //SEG79 [8] phi (byte*) line_cursor#13 = (byte*~) print_ln::$0 [phi:main::@16->main::@1#0] -- register_copy + //SEG80 [8] phi (byte*) char_cursor#32 = (byte*~) char_cursor#49 [phi:main::@16->main::@1#1] -- register_copy + //SEG81 [8] phi (byte) main::i#10 = (byte) main::i#1 [phi:main::@16->main::@1#2] -- register_copy + jmp b1 +} +//SEG82 print_ln +print_ln: { + .label _0 = 3 + //SEG83 [39] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + b1_from_print_ln: + b1_from_b1: + //SEG84 [39] phi (byte*) line_cursor#6 = (byte*) line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG85 print_ln::@1 + b1: + //SEG86 [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1=zpptrby1_plus_coby1 + lda _0 + clc + adc #$28 + sta _0 + bcc !+ + inc _0+1 + !: + //SEG87 [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + lda _0+1 + cmp char_cursor+1 + bcc b1_from_b1 + bne !+ + lda _0 + cmp char_cursor + bcc b1_from_b1 + !: + //SEG88 print_ln::@return + breturn: + //SEG89 [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + rts +} +//SEG90 print_word +print_word: { + .label w = 9 + //SEG91 [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG92 [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) -- xby=aby + tax + //SEG93 [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + //SEG94 [50] phi from print_word to print_byte [phi:print_word->print_byte] + print_byte_from_print_word: + //SEG95 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#32 [phi:print_word->print_byte#0] -- register_copy + //SEG96 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy + jsr print_byte + //SEG97 print_word::@1 + b1: + //SEG98 [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) -- aby=_lo_zpwo1 + lda w + //SEG99 [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) -- xby=aby + tax + //SEG100 [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG101 [50] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte] + print_byte_from_b1: + //SEG102 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#10 [phi:print_word::@1->print_byte#0] -- register_copy + //SEG103 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy + jsr print_byte + //SEG104 print_word::@return + breturn: + //SEG105 [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG106 print_byte +print_byte: { + //SEG107 [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) -- yby=xby_ror_4 + txa + lsr + lsr + lsr + lsr + tay + //SEG108 [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) -- aby=cowo1_derefidx_yby + lda hextab,y + //SEG109 [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) + // (byte) print_char::ch#0 = (byte~) print_byte::$1 // register copy reg byte a + //SEG110 [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + //SEG111 [60] phi from print_byte to print_char [phi:print_byte->print_char] + print_char_from_print_byte: + //SEG112 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#31 [phi:print_byte->print_char#0] -- register_copy + //SEG113 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + //SEG114 print_byte::@1 + b1: + //SEG115 [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) -- aby=xby_band_coby1 + txa + and #$f + //SEG116 [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) -- aby=cowo1_derefidx_aby + tax + lda hextab,x + //SEG117 [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) + // (byte) print_char::ch#1 = (byte~) print_byte::$4 // register copy reg byte a + //SEG118 [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG119 [60] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + print_char_from_b1: + //SEG120 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy + //SEG121 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + //SEG122 print_byte::@return + breturn: + //SEG123 [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG124 print_char +print_char: { + //SEG125 [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) -- _deref_zpptrby1=aby + ldy #0 + sta (char_cursor),y + //SEG126 [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) -- zpptrby1=_inc_zpptrby1 + inc char_cursor + bne !+ + inc char_cursor+1 + !: + //SEG127 print_char::@return + breturn: + //SEG128 [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG129 getFAC +getFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + .label return = 9 + //SEG130 asm { jsr$b1aasty$festa$ff } + jsr $b1aa + sty $fe + sta $ff + //SEG131 [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) -- zpwo1=coby1_setlo__deref_cowo2 + lda lo + sta w + lda #0 + sta w+1 + //SEG132 [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) -- zpwo1=zpwo1_sethi__deref_cowo1 + lda hi + sta return+1 + //SEG133 getFAC::@return + breturn: + //SEG134 [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + rts +} +//SEG135 addMEMtoFAC +addMEMtoFAC: { + //SEG136 [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG137 [72] phi from addMEMtoFAC to prepareMEM [phi:addMEMtoFAC->prepareMEM] + prepareMEM_from_addMEMtoFAC: + //SEG138 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_127#0 [phi:addMEMtoFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG139 addMEMtoFAC::@1 + b1: + //SEG140 asm { lda$feldy$ffjsr$b867 } + lda $fe + ldy $ff + jsr $b867 + //SEG141 addMEMtoFAC::@return + breturn: + //SEG142 [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG143 prepareMEM +prepareMEM: { + .label mem = 7 + //SEG144 [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) -- aby=_lo_zpptrby1 + lda mem + //SEG145 [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) -- _deref_cowo1=aby + sta memLo + //SEG146 [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) -- aby=_hi_zpptrby1 + lda mem+1 + //SEG147 [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta memHi + //SEG148 prepareMEM::@return + breturn: + //SEG149 [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG150 mulFACbyMEM +mulFACbyMEM: { + .label mem = 7 + //SEG151 [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) + // (byte*) prepareMEM::mem#3 = (byte*) mulFACbyMEM::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG152 [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG153 [72] phi from mulFACbyMEM to prepareMEM [phi:mulFACbyMEM->prepareMEM] + prepareMEM_from_mulFACbyMEM: + //SEG154 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#3 [phi:mulFACbyMEM->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG155 mulFACbyMEM::@1 + b1: + //SEG156 asm { lda$feldy$ffjsr$ba28 } + lda $fe + ldy $ff + jsr $ba28 + //SEG157 mulFACbyMEM::@return + breturn: + //SEG158 [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG159 sinFAC +sinFAC: { + //SEG160 asm { jsr$e26b } + jsr $e26b + //SEG161 sinFAC::@return + breturn: + //SEG162 [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG163 divMEMbyFAC +divMEMbyFAC: { + //SEG164 [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG165 [72] phi from divMEMbyFAC to prepareMEM [phi:divMEMbyFAC->prepareMEM] + prepareMEM_from_divMEMbyFAC: + //SEG166 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_i#0 [phi:divMEMbyFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_i + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG167 divMEMbyFAC::@1 + b1: + //SEG168 asm { lda$feldy$ffjsr$bb0f } + lda $fe + ldy $ff + jsr $bb0f + //SEG169 divMEMbyFAC::@return + breturn: + //SEG170 [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG171 setFAC +setFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + //SEG172 [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) -- aby=_lo_zpwo1 + lda w + //SEG173 [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) -- _deref_cowo1=aby + sta lo + //SEG174 [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG175 [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta hi + //SEG176 asm { ldy$felda$ffjsr$b391 } + ldy $fe + lda $ff + jsr $b391 + //SEG177 setFAC::@return + breturn: + //SEG178 [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG179 setMEMtoFAC +setMEMtoFAC: { + .label mem = 7 + //SEG180 [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) + // (byte*) prepareMEM::mem#0 = (byte*) setMEMtoFAC::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG181 [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG182 [72] phi from setMEMtoFAC to prepareMEM [phi:setMEMtoFAC->prepareMEM] + prepareMEM_from_setMEMtoFAC: + //SEG183 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#0 [phi:setMEMtoFAC->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG184 setMEMtoFAC::@1 + b1: + //SEG185 asm { ldx$feldy$ffjsr$bbd4 } + ldx $fe + ldy $ff + jsr $bbd4 + //SEG186 setMEMtoFAC::@return + breturn: + //SEG187 [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} + +Replacing label b1_from_b1 with b1 +Replacing label b1_from_b1 with b1 +Removing instruction bbegin: +Removing instruction b31_from_bbegin: +Removing instruction main_from_b31: +Removing instruction bend_from_b31: +Removing instruction b3_from_main: +Removing instruction setMEMtoFAC_from_b3: +Removing instruction b5_from_b1: +Removing instruction mulFACbyMEM_from_b5: +Removing instruction b6_from_b5: +Removing instruction setMEMtoFAC_from_b6: +Removing instruction b7_from_b6: +Removing instruction setFAC_from_b7: +Removing instruction b8_from_b7: +Removing instruction divMEMbyFAC_from_b8: +Removing instruction b9_from_b8: +Removing instruction b10_from_b9: +Removing instruction mulFACbyMEM_from_b10: +Removing instruction b11_from_b10: +Removing instruction addMEMtoFAC_from_b11: +Removing instruction b12_from_b11: +Removing instruction b14_from_b13: +Removing instruction print_ln_from_b14: +Removing instruction b1_from_print_ln: +Removing instruction b1_from_b1: +Succesful ASM optimization Pass5RedundantLabelElimination +ASSEMBLER +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .const memLo = $fe + .const memHi = $ff + .const f_2pi = $e2e5 + .label char_cursor = 5 + .label line_cursor = 3 + hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + f_i: .byte 0, 0, 0, 0, 0 + f_127: .byte 0, 0, 0, 0, 0 +//SEG2 @begin +//SEG3 [1] phi from @begin to @31 [phi:@begin->@31] +//SEG4 @31 +b31: +//SEG5 [2] call main param-assignment [ ] ( ) +//SEG6 [4] phi from @31 to main [phi:@31->main] + jsr main +//SEG7 [3] phi from @31 to @end [phi:@31->@end] +//SEG8 @end +bend: +//SEG9 main +main: { + .label _2 = 9 + .label _11 = 9 + .label i = 2 + //SEG10 [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + //SEG11 [89] phi from main to setFAC [phi:main->setFAC] + setFAC_from_main: + //SEG12 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 127 [phi:main->setFAC#0] -- zpwo1=coby1 + lda #$7f + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG13 [6] phi from main to main::@3 [phi:main->main::@3] + //SEG14 main::@3 + b3: + //SEG15 [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + //SEG16 [96] phi from main::@3 to setMEMtoFAC [phi:main::@3->setMEMtoFAC] + //SEG17 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_127#0 [phi:main::@3->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_127 + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG18 [8] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + //SEG19 [8] phi (byte*) line_cursor#13 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#0] -- zpptrby1=cowo1 + lda #<$400 + sta line_cursor + lda #>$400 + sta line_cursor+1 + //SEG20 [8] phi (byte*) char_cursor#32 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#1] -- zpptrby1=cowo1 + lda #<$400 + sta char_cursor + lda #>$400 + sta char_cursor+1 + //SEG21 [8] phi (byte) main::i#10 = (byte/signed byte/word/signed word) 1 [phi:main::@3->main::@1#2] -- zpby1=coby1 + lda #1 + sta i + //SEG22 main::@1 + b1: + //SEG23 [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) -- zpwo1=_word_zpby1 + lda i + sta _2 + lda #0 + sta _2+1 + //SEG24 [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) + // (word) setFAC::w#1 = (word~) main::$2 // register copy zp ZP_WORD:9 + //SEG25 [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG26 [89] phi from main::@1 to setFAC [phi:main::@1->setFAC] + setFAC_from_b1: + //SEG27 [89] phi (word) setFAC::w#3 = (word) setFAC::w#1 [phi:main::@1->setFAC#0] -- register_copy + jsr setFAC + //SEG28 [12] phi from main::@1 to main::@5 [phi:main::@1->main::@5] + //SEG29 main::@5 + b5: + //SEG30 [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG31 [78] phi from main::@5 to mulFACbyMEM [phi:main::@5->mulFACbyMEM] + //SEG32 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) f_2pi#0 [phi:main::@5->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_2pi + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG33 [14] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + //SEG34 main::@6 + b6: + //SEG35 [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG36 [96] phi from main::@6 to setMEMtoFAC [phi:main::@6->setMEMtoFAC] + //SEG37 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_i#0 [phi:main::@6->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_i + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG38 [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7] + //SEG39 main::@7 + b7: + //SEG40 [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG41 [89] phi from main::@7 to setFAC [phi:main::@7->setFAC] + //SEG42 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 25 [phi:main::@7->setFAC#0] -- zpwo1=coby1 + lda #$19 + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG43 [18] phi from main::@7 to main::@8 [phi:main::@7->main::@8] + //SEG44 main::@8 + b8: + //SEG45 [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG46 [85] phi from main::@8 to divMEMbyFAC [phi:main::@8->divMEMbyFAC] + jsr divMEMbyFAC + //SEG47 [20] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + //SEG48 main::@9 + b9: + //SEG49 [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + jsr sinFAC + //SEG50 [22] phi from main::@9 to main::@10 [phi:main::@9->main::@10] + //SEG51 main::@10 + b10: + //SEG52 [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG53 [78] phi from main::@10 to mulFACbyMEM [phi:main::@10->mulFACbyMEM] + //SEG54 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte[]) f_127#0 [phi:main::@10->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG55 [24] phi from main::@10 to main::@11 [phi:main::@10->main::@11] + //SEG56 main::@11 + b11: + //SEG57 [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG58 [68] phi from main::@11 to addMEMtoFAC [phi:main::@11->addMEMtoFAC] + jsr addMEMtoFAC + //SEG59 [26] phi from main::@11 to main::@12 [phi:main::@11->main::@12] + //SEG60 main::@12 + b12: + //SEG61 [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + jsr getFAC + //SEG62 [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) + // (word) getFAC::return#2 = (word) getFAC::return#0 // register copy zp ZP_WORD:9 + //SEG63 main::@13 + b13: + //SEG64 [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) + // (word~) main::$11 = (word) getFAC::return#2 // register copy zp ZP_WORD:9 + //SEG65 [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) + // (word) print_word::w#0 = (word~) main::$11 // register copy zp ZP_WORD:9 + //SEG66 [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + jsr print_word + //SEG67 [32] phi from main::@13 to main::@14 [phi:main::@13->main::@14] + //SEG68 main::@14 + b14: + //SEG69 [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + //SEG70 [38] phi from main::@14 to print_ln [phi:main::@14->print_ln] + jsr print_ln + //SEG71 main::@15 + b15: + //SEG72 [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1=_inc_zpby1 + inc i + //SEG73 [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1_neq_coby1_then_la1 + lda i + cmp #$1a + bne b16 + //SEG74 main::@return + breturn: + //SEG75 [36] return [ ] ( main:2 [ ] ) + rts + //SEG76 main::@16 + b16: + //SEG77 [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + lda print_ln._0 + sta char_cursor + lda print_ln._0+1 + sta char_cursor+1 + //SEG78 [8] phi from main::@16 to main::@1 [phi:main::@16->main::@1] + b1_from_b16: + //SEG79 [8] phi (byte*) line_cursor#13 = (byte*~) print_ln::$0 [phi:main::@16->main::@1#0] -- register_copy + //SEG80 [8] phi (byte*) char_cursor#32 = (byte*~) char_cursor#49 [phi:main::@16->main::@1#1] -- register_copy + //SEG81 [8] phi (byte) main::i#10 = (byte) main::i#1 [phi:main::@16->main::@1#2] -- register_copy + jmp b1 +} +//SEG82 print_ln +print_ln: { + .label _0 = 3 + //SEG83 [39] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + //SEG84 [39] phi (byte*) line_cursor#6 = (byte*) line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG85 print_ln::@1 + b1: + //SEG86 [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1=zpptrby1_plus_coby1 + lda _0 + clc + adc #$28 + sta _0 + bcc !+ + inc _0+1 + !: + //SEG87 [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + lda _0+1 + cmp char_cursor+1 + bcc b1 + bne !+ + lda _0 + cmp char_cursor + bcc b1 + !: + //SEG88 print_ln::@return + breturn: + //SEG89 [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + rts +} +//SEG90 print_word +print_word: { + .label w = 9 + //SEG91 [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG92 [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) -- xby=aby + tax + //SEG93 [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + //SEG94 [50] phi from print_word to print_byte [phi:print_word->print_byte] + print_byte_from_print_word: + //SEG95 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#32 [phi:print_word->print_byte#0] -- register_copy + //SEG96 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy + jsr print_byte + //SEG97 print_word::@1 + b1: + //SEG98 [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) -- aby=_lo_zpwo1 + lda w + //SEG99 [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) -- xby=aby + tax + //SEG100 [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG101 [50] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte] + print_byte_from_b1: + //SEG102 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#10 [phi:print_word::@1->print_byte#0] -- register_copy + //SEG103 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy + jsr print_byte + //SEG104 print_word::@return + breturn: + //SEG105 [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG106 print_byte +print_byte: { + //SEG107 [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) -- yby=xby_ror_4 + txa + lsr + lsr + lsr + lsr + tay + //SEG108 [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) -- aby=cowo1_derefidx_yby + lda hextab,y + //SEG109 [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) + // (byte) print_char::ch#0 = (byte~) print_byte::$1 // register copy reg byte a + //SEG110 [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + //SEG111 [60] phi from print_byte to print_char [phi:print_byte->print_char] + print_char_from_print_byte: + //SEG112 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#31 [phi:print_byte->print_char#0] -- register_copy + //SEG113 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + //SEG114 print_byte::@1 + b1: + //SEG115 [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) -- aby=xby_band_coby1 + txa + and #$f + //SEG116 [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) -- aby=cowo1_derefidx_aby + tax + lda hextab,x + //SEG117 [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) + // (byte) print_char::ch#1 = (byte~) print_byte::$4 // register copy reg byte a + //SEG118 [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG119 [60] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + print_char_from_b1: + //SEG120 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy + //SEG121 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + //SEG122 print_byte::@return + breturn: + //SEG123 [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG124 print_char +print_char: { + //SEG125 [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) -- _deref_zpptrby1=aby + ldy #0 + sta (char_cursor),y + //SEG126 [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) -- zpptrby1=_inc_zpptrby1 + inc char_cursor + bne !+ + inc char_cursor+1 + !: + //SEG127 print_char::@return + breturn: + //SEG128 [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG129 getFAC +getFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + .label return = 9 + //SEG130 asm { jsr$b1aasty$festa$ff } + jsr $b1aa + sty $fe + sta $ff + //SEG131 [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) -- zpwo1=coby1_setlo__deref_cowo2 + lda lo + sta w + lda #0 + sta w+1 + //SEG132 [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) -- zpwo1=zpwo1_sethi__deref_cowo1 + lda hi + sta return+1 + //SEG133 getFAC::@return + breturn: + //SEG134 [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + rts +} +//SEG135 addMEMtoFAC +addMEMtoFAC: { + //SEG136 [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG137 [72] phi from addMEMtoFAC to prepareMEM [phi:addMEMtoFAC->prepareMEM] + prepareMEM_from_addMEMtoFAC: + //SEG138 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_127#0 [phi:addMEMtoFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG139 addMEMtoFAC::@1 + b1: + //SEG140 asm { lda$feldy$ffjsr$b867 } + lda $fe + ldy $ff + jsr $b867 + //SEG141 addMEMtoFAC::@return + breturn: + //SEG142 [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG143 prepareMEM +prepareMEM: { + .label mem = 7 + //SEG144 [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) -- aby=_lo_zpptrby1 + lda mem + //SEG145 [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) -- _deref_cowo1=aby + sta memLo + //SEG146 [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) -- aby=_hi_zpptrby1 + lda mem+1 + //SEG147 [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta memHi + //SEG148 prepareMEM::@return + breturn: + //SEG149 [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG150 mulFACbyMEM +mulFACbyMEM: { + .label mem = 7 + //SEG151 [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) + // (byte*) prepareMEM::mem#3 = (byte*) mulFACbyMEM::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG152 [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG153 [72] phi from mulFACbyMEM to prepareMEM [phi:mulFACbyMEM->prepareMEM] + prepareMEM_from_mulFACbyMEM: + //SEG154 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#3 [phi:mulFACbyMEM->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG155 mulFACbyMEM::@1 + b1: + //SEG156 asm { lda$feldy$ffjsr$ba28 } + lda $fe + ldy $ff + jsr $ba28 + //SEG157 mulFACbyMEM::@return + breturn: + //SEG158 [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG159 sinFAC +sinFAC: { + //SEG160 asm { jsr$e26b } + jsr $e26b + //SEG161 sinFAC::@return + breturn: + //SEG162 [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG163 divMEMbyFAC +divMEMbyFAC: { + //SEG164 [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG165 [72] phi from divMEMbyFAC to prepareMEM [phi:divMEMbyFAC->prepareMEM] + prepareMEM_from_divMEMbyFAC: + //SEG166 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_i#0 [phi:divMEMbyFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_i + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG167 divMEMbyFAC::@1 + b1: + //SEG168 asm { lda$feldy$ffjsr$bb0f } + lda $fe + ldy $ff + jsr $bb0f + //SEG169 divMEMbyFAC::@return + breturn: + //SEG170 [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG171 setFAC +setFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + //SEG172 [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) -- aby=_lo_zpwo1 + lda w + //SEG173 [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) -- _deref_cowo1=aby + sta lo + //SEG174 [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG175 [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta hi + //SEG176 asm { ldy$felda$ffjsr$b391 } + ldy $fe + lda $ff + jsr $b391 + //SEG177 setFAC::@return + breturn: + //SEG178 [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG179 setMEMtoFAC +setMEMtoFAC: { + .label mem = 7 + //SEG180 [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) + // (byte*) prepareMEM::mem#0 = (byte*) setMEMtoFAC::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG181 [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG182 [72] phi from setMEMtoFAC to prepareMEM [phi:setMEMtoFAC->prepareMEM] + prepareMEM_from_setMEMtoFAC: + //SEG183 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#0 [phi:setMEMtoFAC->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG184 setMEMtoFAC::@1 + b1: + //SEG185 asm { ldx$feldy$ffjsr$bbd4 } + ldx $fe + ldy $ff + jsr $bbd4 + //SEG186 setMEMtoFAC::@return + breturn: + //SEG187 [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} + +Removing instruction b31: +Removing instruction bend: +Removing instruction setFAC_from_main: +Removing instruction b3: +Removing instruction b1_from_b3: +Removing instruction setFAC_from_b1: +Removing instruction b5: +Removing instruction b6: +Removing instruction b7: +Removing instruction b8: +Removing instruction b9: +Removing instruction b10: +Removing instruction b11: +Removing instruction b12: +Removing instruction b13: +Removing instruction b14: +Removing instruction b15: +Removing instruction breturn: +Removing instruction b1_from_b16: +Removing instruction breturn: +Removing instruction print_byte_from_print_word: +Removing instruction b1: +Removing instruction print_byte_from_b1: +Removing instruction breturn: +Removing instruction print_char_from_print_byte: +Removing instruction b1: +Removing instruction print_char_from_b1: +Removing instruction breturn: +Removing instruction breturn: +Removing instruction breturn: +Removing instruction prepareMEM_from_addMEMtoFAC: +Removing instruction b1: +Removing instruction breturn: +Removing instruction breturn: +Removing instruction prepareMEM_from_mulFACbyMEM: +Removing instruction b1: +Removing instruction breturn: +Removing instruction breturn: +Removing instruction prepareMEM_from_divMEMbyFAC: +Removing instruction b1: +Removing instruction breturn: +Removing instruction breturn: +Removing instruction prepareMEM_from_setMEMtoFAC: +Removing instruction b1: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +ASSEMBLER +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .const memLo = $fe + .const memHi = $ff + .const f_2pi = $e2e5 + .label char_cursor = 5 + .label line_cursor = 3 + hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + f_i: .byte 0, 0, 0, 0, 0 + f_127: .byte 0, 0, 0, 0, 0 +//SEG2 @begin +//SEG3 [1] phi from @begin to @31 [phi:@begin->@31] +//SEG4 @31 +//SEG5 [2] call main param-assignment [ ] ( ) +//SEG6 [4] phi from @31 to main [phi:@31->main] + jsr main +//SEG7 [3] phi from @31 to @end [phi:@31->@end] +//SEG8 @end +//SEG9 main +main: { + .label _2 = 9 + .label _11 = 9 + .label i = 2 + //SEG10 [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + //SEG11 [89] phi from main to setFAC [phi:main->setFAC] + //SEG12 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 127 [phi:main->setFAC#0] -- zpwo1=coby1 + lda #$7f + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG13 [6] phi from main to main::@3 [phi:main->main::@3] + //SEG14 main::@3 + //SEG15 [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + //SEG16 [96] phi from main::@3 to setMEMtoFAC [phi:main::@3->setMEMtoFAC] + //SEG17 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_127#0 [phi:main::@3->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_127 + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG18 [8] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + //SEG19 [8] phi (byte*) line_cursor#13 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#0] -- zpptrby1=cowo1 + lda #<$400 + sta line_cursor + lda #>$400 + sta line_cursor+1 + //SEG20 [8] phi (byte*) char_cursor#32 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#1] -- zpptrby1=cowo1 + lda #<$400 + sta char_cursor + lda #>$400 + sta char_cursor+1 + //SEG21 [8] phi (byte) main::i#10 = (byte/signed byte/word/signed word) 1 [phi:main::@3->main::@1#2] -- zpby1=coby1 + lda #1 + sta i + //SEG22 main::@1 + b1: + //SEG23 [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) -- zpwo1=_word_zpby1 + lda i + sta _2 + lda #0 + sta _2+1 + //SEG24 [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) + // (word) setFAC::w#1 = (word~) main::$2 // register copy zp ZP_WORD:9 + //SEG25 [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG26 [89] phi from main::@1 to setFAC [phi:main::@1->setFAC] + //SEG27 [89] phi (word) setFAC::w#3 = (word) setFAC::w#1 [phi:main::@1->setFAC#0] -- register_copy + jsr setFAC + //SEG28 [12] phi from main::@1 to main::@5 [phi:main::@1->main::@5] + //SEG29 main::@5 + //SEG30 [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG31 [78] phi from main::@5 to mulFACbyMEM [phi:main::@5->mulFACbyMEM] + //SEG32 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) f_2pi#0 [phi:main::@5->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_2pi + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG33 [14] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + //SEG34 main::@6 + //SEG35 [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG36 [96] phi from main::@6 to setMEMtoFAC [phi:main::@6->setMEMtoFAC] + //SEG37 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_i#0 [phi:main::@6->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_i + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG38 [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7] + //SEG39 main::@7 + //SEG40 [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG41 [89] phi from main::@7 to setFAC [phi:main::@7->setFAC] + //SEG42 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 25 [phi:main::@7->setFAC#0] -- zpwo1=coby1 + lda #$19 + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG43 [18] phi from main::@7 to main::@8 [phi:main::@7->main::@8] + //SEG44 main::@8 + //SEG45 [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG46 [85] phi from main::@8 to divMEMbyFAC [phi:main::@8->divMEMbyFAC] + jsr divMEMbyFAC + //SEG47 [20] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + //SEG48 main::@9 + //SEG49 [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + jsr sinFAC + //SEG50 [22] phi from main::@9 to main::@10 [phi:main::@9->main::@10] + //SEG51 main::@10 + //SEG52 [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG53 [78] phi from main::@10 to mulFACbyMEM [phi:main::@10->mulFACbyMEM] + //SEG54 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte[]) f_127#0 [phi:main::@10->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG55 [24] phi from main::@10 to main::@11 [phi:main::@10->main::@11] + //SEG56 main::@11 + //SEG57 [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG58 [68] phi from main::@11 to addMEMtoFAC [phi:main::@11->addMEMtoFAC] + jsr addMEMtoFAC + //SEG59 [26] phi from main::@11 to main::@12 [phi:main::@11->main::@12] + //SEG60 main::@12 + //SEG61 [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + jsr getFAC + //SEG62 [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) + // (word) getFAC::return#2 = (word) getFAC::return#0 // register copy zp ZP_WORD:9 + //SEG63 main::@13 + //SEG64 [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) + // (word~) main::$11 = (word) getFAC::return#2 // register copy zp ZP_WORD:9 + //SEG65 [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) + // (word) print_word::w#0 = (word~) main::$11 // register copy zp ZP_WORD:9 + //SEG66 [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + jsr print_word + //SEG67 [32] phi from main::@13 to main::@14 [phi:main::@13->main::@14] + //SEG68 main::@14 + //SEG69 [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + //SEG70 [38] phi from main::@14 to print_ln [phi:main::@14->print_ln] + jsr print_ln + //SEG71 main::@15 + //SEG72 [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1=_inc_zpby1 + inc i + //SEG73 [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1_neq_coby1_then_la1 + lda i + cmp #$1a + bne b16 + //SEG74 main::@return + //SEG75 [36] return [ ] ( main:2 [ ] ) + rts + //SEG76 main::@16 + b16: + //SEG77 [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + lda print_ln._0 + sta char_cursor + lda print_ln._0+1 + sta char_cursor+1 + //SEG78 [8] phi from main::@16 to main::@1 [phi:main::@16->main::@1] + //SEG79 [8] phi (byte*) line_cursor#13 = (byte*~) print_ln::$0 [phi:main::@16->main::@1#0] -- register_copy + //SEG80 [8] phi (byte*) char_cursor#32 = (byte*~) char_cursor#49 [phi:main::@16->main::@1#1] -- register_copy + //SEG81 [8] phi (byte) main::i#10 = (byte) main::i#1 [phi:main::@16->main::@1#2] -- register_copy + jmp b1 +} +//SEG82 print_ln +print_ln: { + .label _0 = 3 + //SEG83 [39] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + //SEG84 [39] phi (byte*) line_cursor#6 = (byte*) line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG85 print_ln::@1 + b1: + //SEG86 [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1=zpptrby1_plus_coby1 + lda _0 + clc + adc #$28 + sta _0 + bcc !+ + inc _0+1 + !: + //SEG87 [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + lda _0+1 + cmp char_cursor+1 + bcc b1 + bne !+ + lda _0 + cmp char_cursor + bcc b1 + !: + //SEG88 print_ln::@return + //SEG89 [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + rts +} +//SEG90 print_word +print_word: { + .label w = 9 + //SEG91 [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG92 [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) -- xby=aby + tax + //SEG93 [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + //SEG94 [50] phi from print_word to print_byte [phi:print_word->print_byte] + //SEG95 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#32 [phi:print_word->print_byte#0] -- register_copy + //SEG96 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy + jsr print_byte + //SEG97 print_word::@1 + //SEG98 [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) -- aby=_lo_zpwo1 + lda w + //SEG99 [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) -- xby=aby + tax + //SEG100 [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG101 [50] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte] + //SEG102 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#10 [phi:print_word::@1->print_byte#0] -- register_copy + //SEG103 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy + jsr print_byte + //SEG104 print_word::@return + //SEG105 [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG106 print_byte +print_byte: { + //SEG107 [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) -- yby=xby_ror_4 + txa + lsr + lsr + lsr + lsr + tay + //SEG108 [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) -- aby=cowo1_derefidx_yby + lda hextab,y + //SEG109 [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) + // (byte) print_char::ch#0 = (byte~) print_byte::$1 // register copy reg byte a + //SEG110 [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + //SEG111 [60] phi from print_byte to print_char [phi:print_byte->print_char] + //SEG112 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#31 [phi:print_byte->print_char#0] -- register_copy + //SEG113 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + //SEG114 print_byte::@1 + //SEG115 [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) -- aby=xby_band_coby1 + txa + and #$f + //SEG116 [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) -- aby=cowo1_derefidx_aby + tax + lda hextab,x + //SEG117 [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) + // (byte) print_char::ch#1 = (byte~) print_byte::$4 // register copy reg byte a + //SEG118 [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG119 [60] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + //SEG120 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy + //SEG121 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + //SEG122 print_byte::@return + //SEG123 [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG124 print_char +print_char: { + //SEG125 [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) -- _deref_zpptrby1=aby + ldy #0 + sta (char_cursor),y + //SEG126 [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) -- zpptrby1=_inc_zpptrby1 + inc char_cursor + bne !+ + inc char_cursor+1 + !: + //SEG127 print_char::@return + //SEG128 [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG129 getFAC +getFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + .label return = 9 + //SEG130 asm { jsr$b1aasty$festa$ff } + jsr $b1aa + sty $fe + sta $ff + //SEG131 [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) -- zpwo1=coby1_setlo__deref_cowo2 + lda lo + sta w + lda #0 + sta w+1 + //SEG132 [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) -- zpwo1=zpwo1_sethi__deref_cowo1 + lda hi + sta return+1 + //SEG133 getFAC::@return + //SEG134 [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + rts +} +//SEG135 addMEMtoFAC +addMEMtoFAC: { + //SEG136 [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG137 [72] phi from addMEMtoFAC to prepareMEM [phi:addMEMtoFAC->prepareMEM] + //SEG138 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_127#0 [phi:addMEMtoFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG139 addMEMtoFAC::@1 + //SEG140 asm { lda$feldy$ffjsr$b867 } + lda $fe + ldy $ff + jsr $b867 + //SEG141 addMEMtoFAC::@return + //SEG142 [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG143 prepareMEM +prepareMEM: { + .label mem = 7 + //SEG144 [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) -- aby=_lo_zpptrby1 + lda mem + //SEG145 [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) -- _deref_cowo1=aby + sta memLo + //SEG146 [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) -- aby=_hi_zpptrby1 + lda mem+1 + //SEG147 [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta memHi + //SEG148 prepareMEM::@return + //SEG149 [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG150 mulFACbyMEM +mulFACbyMEM: { + .label mem = 7 + //SEG151 [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) + // (byte*) prepareMEM::mem#3 = (byte*) mulFACbyMEM::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG152 [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG153 [72] phi from mulFACbyMEM to prepareMEM [phi:mulFACbyMEM->prepareMEM] + //SEG154 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#3 [phi:mulFACbyMEM->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG155 mulFACbyMEM::@1 + //SEG156 asm { lda$feldy$ffjsr$ba28 } + lda $fe + ldy $ff + jsr $ba28 + //SEG157 mulFACbyMEM::@return + //SEG158 [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG159 sinFAC +sinFAC: { + //SEG160 asm { jsr$e26b } + jsr $e26b + //SEG161 sinFAC::@return + //SEG162 [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG163 divMEMbyFAC +divMEMbyFAC: { + //SEG164 [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG165 [72] phi from divMEMbyFAC to prepareMEM [phi:divMEMbyFAC->prepareMEM] + //SEG166 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_i#0 [phi:divMEMbyFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_i + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG167 divMEMbyFAC::@1 + //SEG168 asm { lda$feldy$ffjsr$bb0f } + lda $fe + ldy $ff + jsr $bb0f + //SEG169 divMEMbyFAC::@return + //SEG170 [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG171 setFAC +setFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + //SEG172 [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) -- aby=_lo_zpwo1 + lda w + //SEG173 [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) -- _deref_cowo1=aby + sta lo + //SEG174 [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG175 [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta hi + //SEG176 asm { ldy$felda$ffjsr$b391 } + ldy $fe + lda $ff + jsr $b391 + //SEG177 setFAC::@return + //SEG178 [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG179 setMEMtoFAC +setMEMtoFAC: { + .label mem = 7 + //SEG180 [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) + // (byte*) prepareMEM::mem#0 = (byte*) setMEMtoFAC::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG181 [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG182 [72] phi from setMEMtoFAC to prepareMEM [phi:setMEMtoFAC->prepareMEM] + //SEG183 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#0 [phi:setMEMtoFAC->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG184 setMEMtoFAC::@1 + //SEG185 asm { ldx$feldy$ffjsr$bbd4 } + ldx $fe + ldy $ff + jsr $bbd4 + //SEG186 setMEMtoFAC::@return + //SEG187 [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} + +FINAL SYMBOL TABLE +(label) @31 +(label) @begin +(label) @end +(void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) +(label) addMEMtoFAC::@1 +(label) addMEMtoFAC::@return +(byte*) addMEMtoFAC::mem +(byte*) char_cursor +(byte*) char_cursor#10 char_cursor zp ZP_PTR_BYTE:5 5.631578947368422 +(byte*) char_cursor#23 char_cursor zp ZP_PTR_BYTE:5 4.0 +(byte*) char_cursor#31 char_cursor zp ZP_PTR_BYTE:5 1.5 +(byte*) char_cursor#32 char_cursor zp ZP_PTR_BYTE:5 0.52 +(byte*~) char_cursor#49 char_cursor zp ZP_PTR_BYTE:5 22.0 +(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) +(label) divMEMbyFAC::@1 +(label) divMEMbyFAC::@return +(byte*) divMEMbyFAC::mem +(byte[]) f_127 +(const byte[]) f_127#0 f_127 = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } +(byte*) f_2pi +(const byte*) f_2pi#0 f_2pi = ((byte*))(word) 58085 +(byte[]) f_i +(const byte[]) f_i#0 f_i = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } +(word()) getFAC() +(label) getFAC::@return +(byte*) getFAC::hi +(const byte*) getFAC::hi#0 hi = ((byte*))(byte/word/signed word) 255 +(byte*) getFAC::lo +(const byte*) getFAC::lo#0 lo = ((byte*))(byte/word/signed word) 254 +(word) getFAC::return +(word) getFAC::return#0 return zp ZP_WORD:9 4.333333333333333 +(word) getFAC::return#2 return zp ZP_WORD:9 22.0 +(word) getFAC::w +(word) getFAC::w#1 w zp ZP_WORD:9 4.0 +(byte[]) hextab +(const byte[]) hextab#0 hextab = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } +(byte*) line_cursor +(byte*) line_cursor#13 line_cursor zp ZP_PTR_BYTE:3 0.5 +(byte*) line_cursor#6 line_cursor zp ZP_PTR_BYTE:3 204.0 +(void()) main() +(word~) main::$11 $11 zp ZP_WORD:9 22.0 +(word~) main::$2 $2 zp ZP_WORD:9 22.0 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@14 +(label) main::@15 +(label) main::@16 +(label) main::@3 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(label) main::@return +(byte) main::i +(byte) main::i#1 i zp ZP_BYTE:2 11.0 +(byte) main::i#10 i zp ZP_BYTE:2 1.2692307692307692 +(byte*) memHi +(const byte*) memHi#0 memHi = ((byte*))(byte/word/signed word) 255 +(byte*) memLo +(const byte*) memLo#0 memLo = ((byte*))(byte/word/signed word) 254 +(void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) +(label) mulFACbyMEM::@1 +(label) mulFACbyMEM::@return +(byte*) mulFACbyMEM::mem +(byte*) mulFACbyMEM::mem#2 mem zp ZP_PTR_BYTE:7 2.0 +(void()) prepareMEM((byte*) prepareMEM::mem) +(byte~) prepareMEM::$0 reg byte a 4.0 +(byte~) prepareMEM::$1 reg byte a 4.0 +(label) prepareMEM::@return +(byte*) prepareMEM::mem +(byte*) prepareMEM::mem#0 mem zp ZP_PTR_BYTE:7 4.0 +(byte*) prepareMEM::mem#3 mem zp ZP_PTR_BYTE:7 4.0 +(byte*) prepareMEM::mem#4 mem zp ZP_PTR_BYTE:7 2.6666666666666665 +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 reg byte y 4.0 +(byte~) print_byte::$1 reg byte a 4.0 +(byte~) print_byte::$3 reg byte a 4.0 +(byte~) print_byte::$4 reg byte a 4.0 +(label) print_byte::@1 +(label) print_byte::@return +(byte) print_byte::b +(byte) print_byte::b#0 reg byte x 4.0 +(byte) print_byte::b#1 reg byte x 4.0 +(byte) print_byte::b#2 reg byte x 1.6 +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(byte) print_char::ch#0 reg byte a 4.0 +(byte) print_char::ch#1 reg byte a 4.0 +(byte) print_char::ch#2 reg byte a 6.0 +(void()) print_ln() +(byte*~) print_ln::$0 $0 zp ZP_PTR_BYTE:3 46.42857142857143 +(label) print_ln::@1 +(label) print_ln::@return +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 reg byte a 4.0 +(byte~) print_word::$2 reg byte a 4.0 +(label) print_word::@1 +(label) print_word::@return +(word) print_word::w +(word) print_word::w#0 w zp ZP_WORD:9 3.75 +(void()) setFAC((word) setFAC::w) +(byte~) setFAC::$0 reg byte a 4.0 +(byte~) setFAC::$1 reg byte a 4.0 +(label) setFAC::@return +(byte*) setFAC::hi +(const byte*) setFAC::hi#0 hi = ((byte*))(byte/word/signed word) 255 +(byte*) setFAC::lo +(const byte*) setFAC::lo#0 lo = ((byte*))(byte/word/signed word) 254 +(word) setFAC::w +(word) setFAC::w#1 w zp ZP_WORD:9 22.0 +(word) setFAC::w#3 w zp ZP_WORD:9 5.0 +(void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) +(label) setMEMtoFAC::@1 +(label) setMEMtoFAC::@return +(byte*) setMEMtoFAC::mem +(byte*) setMEMtoFAC::mem#2 mem zp ZP_PTR_BYTE:7 2.0 +(void()) sinFAC() +(label) sinFAC::@return + +zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ] +reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +zp ZP_PTR_BYTE:5 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +zp ZP_PTR_BYTE:7 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 mulFACbyMEM::mem#2 setMEMtoFAC::mem#2 ] +zp ZP_WORD:9 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 main::$11 print_word::w#0 getFAC::w#1 getFAC::return#0 ] +reg byte a [ print_word::$0 ] +reg byte a [ print_word::$2 ] +reg byte y [ print_byte::$0 ] +reg byte a [ print_byte::$1 ] +reg byte a [ print_byte::$3 ] +reg byte a [ print_byte::$4 ] +reg byte a [ prepareMEM::$0 ] +reg byte a [ prepareMEM::$1 ] +reg byte a [ setFAC::$0 ] +reg byte a [ setFAC::$1 ] + +FINAL CODE +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .const memLo = $fe + .const memHi = $ff + .const f_2pi = $e2e5 + .label char_cursor = 5 + .label line_cursor = 3 + hextab: .byte '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + f_i: .byte 0, 0, 0, 0, 0 + f_127: .byte 0, 0, 0, 0, 0 +//SEG2 @begin +//SEG3 [1] phi from @begin to @31 [phi:@begin->@31] +//SEG4 @31 +//SEG5 [2] call main param-assignment [ ] ( ) +//SEG6 [4] phi from @31 to main [phi:@31->main] + jsr main +//SEG7 [3] phi from @31 to @end [phi:@31->@end] +//SEG8 @end +//SEG9 main +main: { + .label _2 = 9 + .label _11 = 9 + .label i = 2 + //SEG10 [5] call setFAC param-assignment [ ] ( main:2 [ ] ) + //SEG11 [89] phi from main to setFAC [phi:main->setFAC] + //SEG12 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 127 [phi:main->setFAC#0] -- zpwo1=coby1 + lda #$7f + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG13 [6] phi from main to main::@3 [phi:main->main::@3] + //SEG14 main::@3 + //SEG15 [7] call setMEMtoFAC param-assignment [ ] ( main:2 [ ] ) + //SEG16 [96] phi from main::@3 to setMEMtoFAC [phi:main::@3->setMEMtoFAC] + //SEG17 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_127#0 [phi:main::@3->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_127 + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG18 [8] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + //SEG19 [8] phi (byte*) line_cursor#13 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#0] -- zpptrby1=cowo1 + lda #<$400 + sta line_cursor + lda #>$400 + sta line_cursor+1 + //SEG20 [8] phi (byte*) char_cursor#32 = ((byte*))(word/signed word) 1024 [phi:main::@3->main::@1#1] -- zpptrby1=cowo1 + lda #<$400 + sta char_cursor + lda #>$400 + sta char_cursor+1 + //SEG21 [8] phi (byte) main::i#10 = (byte/signed byte/word/signed word) 1 [phi:main::@3->main::@1#2] -- zpby1=coby1 + lda #1 + sta i + //SEG22 main::@1 + b1: + //SEG23 [9] (word~) main::$2 ← ((word)) (byte) main::i#10 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$2 ] ) -- zpwo1=_word_zpby1 + lda i + sta _2 + lda #0 + sta _2+1 + //SEG24 [10] (word) setFAC::w#1 ← (word~) main::$2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#1 ] ) + // (word) setFAC::w#1 = (word~) main::$2 // register copy zp ZP_WORD:9 + //SEG25 [11] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG26 [89] phi from main::@1 to setFAC [phi:main::@1->setFAC] + //SEG27 [89] phi (word) setFAC::w#3 = (word) setFAC::w#1 [phi:main::@1->setFAC#0] -- register_copy + jsr setFAC + //SEG28 [12] phi from main::@1 to main::@5 [phi:main::@1->main::@5] + //SEG29 main::@5 + //SEG30 [13] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG31 [78] phi from main::@5 to mulFACbyMEM [phi:main::@5->mulFACbyMEM] + //SEG32 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte*) f_2pi#0 [phi:main::@5->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_2pi + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG33 [14] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + //SEG34 main::@6 + //SEG35 [15] call setMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG36 [96] phi from main::@6 to setMEMtoFAC [phi:main::@6->setMEMtoFAC] + //SEG37 [96] phi (byte*) setMEMtoFAC::mem#2 = (const byte[]) f_i#0 [phi:main::@6->setMEMtoFAC#0] -- zpptrby1=cowo1 + lda #f_i + sta setMEMtoFAC.mem+1 + jsr setMEMtoFAC + //SEG38 [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7] + //SEG39 main::@7 + //SEG40 [17] call setFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG41 [89] phi from main::@7 to setFAC [phi:main::@7->setFAC] + //SEG42 [89] phi (word) setFAC::w#3 = (byte/signed byte/word/signed word) 25 [phi:main::@7->setFAC#0] -- zpwo1=coby1 + lda #$19 + sta setFAC.w + lda #0 + sta setFAC.w+1 + jsr setFAC + //SEG43 [18] phi from main::@7 to main::@8 [phi:main::@7->main::@8] + //SEG44 main::@8 + //SEG45 [19] call divMEMbyFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG46 [85] phi from main::@8 to divMEMbyFAC [phi:main::@8->divMEMbyFAC] + jsr divMEMbyFAC + //SEG47 [20] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + //SEG48 main::@9 + //SEG49 [21] call sinFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + jsr sinFAC + //SEG50 [22] phi from main::@9 to main::@10 [phi:main::@9->main::@10] + //SEG51 main::@10 + //SEG52 [23] call mulFACbyMEM param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG53 [78] phi from main::@10 to mulFACbyMEM [phi:main::@10->mulFACbyMEM] + //SEG54 [78] phi (byte*) mulFACbyMEM::mem#2 = (const byte[]) f_127#0 [phi:main::@10->mulFACbyMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta mulFACbyMEM.mem+1 + jsr mulFACbyMEM + //SEG55 [24] phi from main::@10 to main::@11 [phi:main::@10->main::@11] + //SEG56 main::@11 + //SEG57 [25] call addMEMtoFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG58 [68] phi from main::@11 to addMEMtoFAC [phi:main::@11->addMEMtoFAC] + jsr addMEMtoFAC + //SEG59 [26] phi from main::@11 to main::@12 [phi:main::@11->main::@12] + //SEG60 main::@12 + //SEG61 [27] call getFAC param-assignment [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + jsr getFAC + //SEG62 [28] (word) getFAC::return#2 ← (word) getFAC::return#0 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#2 ] ) + // (word) getFAC::return#2 = (word) getFAC::return#0 // register copy zp ZP_WORD:9 + //SEG63 main::@13 + //SEG64 [29] (word~) main::$11 ← (word) getFAC::return#2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 main::$11 ] ) + // (word~) main::$11 = (word) getFAC::return#2 // register copy zp ZP_WORD:9 + //SEG65 [30] (word) print_word::w#0 ← (word~) main::$11 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ( main:2 [ main::i#10 char_cursor#32 line_cursor#13 print_word::w#0 ] ) + // (word) print_word::w#0 = (word~) main::$11 // register copy zp ZP_WORD:9 + //SEG66 [31] call print_word param-assignment [ main::i#10 line_cursor#13 char_cursor#10 ] ( main:2 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + jsr print_word + //SEG67 [32] phi from main::@13 to main::@14 [phi:main::@13->main::@14] + //SEG68 main::@14 + //SEG69 [33] call print_ln param-assignment [ main::i#10 print_ln::$0 ] ( main:2 [ main::i#10 print_ln::$0 ] ) + //SEG70 [38] phi from main::@14 to print_ln [phi:main::@14->print_ln] + jsr print_ln + //SEG71 main::@15 + //SEG72 [34] (byte) main::i#1 ← ++ (byte) main::i#10 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1=_inc_zpby1 + inc i + //SEG73 [35] if((byte) main::i#1!=(byte/signed byte/word/signed word) 26) goto main::@16 [ main::i#1 print_ln::$0 ] ( main:2 [ main::i#1 print_ln::$0 ] ) -- zpby1_neq_coby1_then_la1 + lda i + cmp #$1a + bne b16 + //SEG74 main::@return + //SEG75 [36] return [ ] ( main:2 [ ] ) + rts + //SEG76 main::@16 + b16: + //SEG77 [37] (byte*~) char_cursor#49 ← (byte*~) print_ln::$0 [ main::i#1 char_cursor#49 print_ln::$0 ] ( main:2 [ main::i#1 char_cursor#49 print_ln::$0 ] ) -- zpptrby1=zpptrby2 + lda print_ln._0 + sta char_cursor + lda print_ln._0+1 + sta char_cursor+1 + //SEG78 [8] phi from main::@16 to main::@1 [phi:main::@16->main::@1] + //SEG79 [8] phi (byte*) line_cursor#13 = (byte*~) print_ln::$0 [phi:main::@16->main::@1#0] -- register_copy + //SEG80 [8] phi (byte*) char_cursor#32 = (byte*~) char_cursor#49 [phi:main::@16->main::@1#1] -- register_copy + //SEG81 [8] phi (byte) main::i#10 = (byte) main::i#1 [phi:main::@16->main::@1#2] -- register_copy + jmp b1 +} +//SEG82 print_ln +print_ln: { + .label _0 = 3 + //SEG83 [39] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + //SEG84 [39] phi (byte*) line_cursor#6 = (byte*) line_cursor#13 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG85 print_ln::@1 + b1: + //SEG86 [40] (byte*~) print_ln::$0 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1=zpptrby1_plus_coby1 + lda _0 + clc + adc #$28 + sta _0 + bcc !+ + inc _0+1 + !: + //SEG87 [41] if((byte*~) print_ln::$0<(byte*) char_cursor#10) goto print_ln::@1 [ print_ln::$0 char_cursor#10 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 char_cursor#10 ] ) -- zpptrby1_lt_zpptrby2_then_la1 + lda _0+1 + cmp char_cursor+1 + bcc b1 + bne !+ + lda _0 + cmp char_cursor + bcc b1 + !: + //SEG88 print_ln::@return + //SEG89 [42] return [ print_ln::$0 ] ( main:2::print_ln:33 [ main::i#10 print_ln::$0 ] ) + rts +} +//SEG90 print_word +print_word: { + .label w = 9 + //SEG91 [43] (byte~) print_word::$0 ← > (word) print_word::w#0 [ char_cursor#32 print_word::w#0 print_word::$0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_word::$0 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG92 [44] (byte) print_byte::b#0 ← (byte~) print_word::$0 [ char_cursor#32 print_word::w#0 print_byte::b#0 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#32 print_word::w#0 print_byte::b#0 ] ) -- xby=aby + tax + //SEG93 [45] call print_byte param-assignment [ print_word::w#0 char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] ) + //SEG94 [50] phi from print_word to print_byte [phi:print_word->print_byte] + //SEG95 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#32 [phi:print_word->print_byte#0] -- register_copy + //SEG96 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#0 [phi:print_word->print_byte#1] -- register_copy + jsr print_byte + //SEG97 print_word::@1 + //SEG98 [46] (byte~) print_word::$2 ← < (word) print_word::w#0 [ char_cursor#10 print_word::$2 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_word::$2 ] ) -- aby=_lo_zpwo1 + lda w + //SEG99 [47] (byte) print_byte::b#1 ← (byte~) print_word::$2 [ char_cursor#10 print_byte::b#1 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#1 ] ) -- xby=aby + tax + //SEG100 [48] call print_byte param-assignment [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG101 [50] phi from print_word::@1 to print_byte [phi:print_word::@1->print_byte] + //SEG102 [50] phi (byte*) char_cursor#31 = (byte*) char_cursor#10 [phi:print_word::@1->print_byte#0] -- register_copy + //SEG103 [50] phi (byte) print_byte::b#2 = (byte) print_byte::b#1 [phi:print_word::@1->print_byte#1] -- register_copy + jsr print_byte + //SEG104 print_word::@return + //SEG105 [49] return [ char_cursor#10 ] ( main:2::print_word:31 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG106 print_byte +print_byte: { + //SEG107 [51] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word) 4 [ print_byte::b#2 char_cursor#31 print_byte::$0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$0 ] ) -- yby=xby_ror_4 + txa + lsr + lsr + lsr + lsr + tay + //SEG108 [52] (byte~) print_byte::$1 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$0 [ print_byte::b#2 char_cursor#31 print_byte::$1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_byte::$1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_byte::$1 ] ) -- aby=cowo1_derefidx_yby + lda hextab,y + //SEG109 [53] (byte) print_char::ch#0 ← (byte~) print_byte::$1 [ print_byte::b#2 char_cursor#31 print_char::ch#0 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#31 print_char::ch#0 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#31 print_char::ch#0 ] ) + // (byte) print_char::ch#0 = (byte~) print_byte::$1 // register copy reg byte a + //SEG110 [54] call print_char param-assignment [ char_cursor#10 print_byte::b#2 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::b#2 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::b#2 ] ) + //SEG111 [60] phi from print_byte to print_char [phi:print_byte->print_char] + //SEG112 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#31 [phi:print_byte->print_char#0] -- register_copy + //SEG113 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#0 [phi:print_byte->print_char#1] -- register_copy + jsr print_char + //SEG114 print_byte::@1 + //SEG115 [55] (byte~) print_byte::$3 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word) 15 [ char_cursor#10 print_byte::$3 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$3 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$3 ] ) -- aby=xby_band_coby1 + txa + and #$f + //SEG116 [56] (byte~) print_byte::$4 ← (const byte[]) hextab#0 *idx (byte~) print_byte::$3 [ char_cursor#10 print_byte::$4 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_byte::$4 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_byte::$4 ] ) -- aby=cowo1_derefidx_aby + tax + lda hextab,x + //SEG117 [57] (byte) print_char::ch#1 ← (byte~) print_byte::$4 [ char_cursor#10 print_char::ch#1 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 print_char::ch#1 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 print_char::ch#1 ] ) + // (byte) print_char::ch#1 = (byte~) print_byte::$4 // register copy reg byte a + //SEG118 [58] call print_char param-assignment [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + //SEG119 [60] phi from print_byte::@1 to print_char [phi:print_byte::@1->print_char] + //SEG120 [60] phi (byte*) char_cursor#23 = (byte*) char_cursor#10 [phi:print_byte::@1->print_char#0] -- register_copy + //SEG121 [60] phi (byte) print_char::ch#2 = (byte) print_char::ch#1 [phi:print_byte::@1->print_char#1] -- register_copy + jsr print_char + //SEG122 print_byte::@return + //SEG123 [59] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG124 print_char +print_char: { + //SEG125 [61] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#23 ] ) -- _deref_zpptrby1=aby + ldy #0 + sta (char_cursor),y + //SEG126 [62] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) -- zpptrby1=_inc_zpptrby1 + inc char_cursor + bne !+ + inc char_cursor+1 + !: + //SEG127 print_char::@return + //SEG128 [63] return [ char_cursor#10 ] ( main:2::print_word:31::print_byte:45::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:54 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:45::print_char:58 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:48::print_char:58 [ main::i#10 line_cursor#13 char_cursor#10 ] ) + rts +} +//SEG129 getFAC +getFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + .label return = 9 + //SEG130 asm { jsr$b1aasty$festa$ff } + jsr $b1aa + sty $fe + sta $ff + //SEG131 [65] (word) getFAC::w#1 ← (byte/signed byte/word/signed word) 0 lo= *((const byte*) getFAC::lo#0) [ getFAC::w#1 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::w#1 ] ) -- zpwo1=coby1_setlo__deref_cowo2 + lda lo + sta w + lda #0 + sta w+1 + //SEG132 [66] (word) getFAC::return#0 ← (word) getFAC::w#1 hi= *((const byte*) getFAC::hi#0) [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) -- zpwo1=zpwo1_sethi__deref_cowo1 + lda hi + sta return+1 + //SEG133 getFAC::@return + //SEG134 [67] return [ getFAC::return#0 ] ( main:2::getFAC:27 [ main::i#10 char_cursor#32 line_cursor#13 getFAC::return#0 ] ) + rts +} +//SEG135 addMEMtoFAC +addMEMtoFAC: { + //SEG136 [69] call prepareMEM param-assignment [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG137 [72] phi from addMEMtoFAC to prepareMEM [phi:addMEMtoFAC->prepareMEM] + //SEG138 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_127#0 [phi:addMEMtoFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_127 + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG139 addMEMtoFAC::@1 + //SEG140 asm { lda$feldy$ffjsr$b867 } + lda $fe + ldy $ff + jsr $b867 + //SEG141 addMEMtoFAC::@return + //SEG142 [71] return [ ] ( main:2::addMEMtoFAC:25 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG143 prepareMEM +prepareMEM: { + .label mem = 7 + //SEG144 [73] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#4 [ prepareMEM::mem#4 prepareMEM::$0 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 prepareMEM::$0 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 prepareMEM::$0 ] ) -- aby=_lo_zpptrby1 + lda mem + //SEG145 [74] *((const byte*) memLo#0) ← (byte~) prepareMEM::$0 [ prepareMEM::mem#4 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::mem#4 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#4 ] ) -- _deref_cowo1=aby + sta memLo + //SEG146 [75] (byte~) prepareMEM::$1 ← > (byte*) prepareMEM::mem#4 [ prepareMEM::$1 ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ prepareMEM::$1 ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::$1 ] ) -- aby=_hi_zpptrby1 + lda mem+1 + //SEG147 [76] *((const byte*) memHi#0) ← (byte~) prepareMEM::$1 [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta memHi + //SEG148 prepareMEM::@return + //SEG149 [77] return [ ] ( main:2::addMEMtoFAC:25::prepareMEM:69 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:13::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23::prepareMEM:80 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::divMEMbyFAC:19::prepareMEM:86 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setMEMtoFAC:7::prepareMEM:98 [ ] main:2::setMEMtoFAC:15::prepareMEM:98 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG150 mulFACbyMEM +mulFACbyMEM: { + .label mem = 7 + //SEG151 [79] (byte*) prepareMEM::mem#3 ← (byte*) mulFACbyMEM::mem#2 [ prepareMEM::mem#3 ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#3 ] ) + // (byte*) prepareMEM::mem#3 = (byte*) mulFACbyMEM::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG152 [80] call prepareMEM param-assignment [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG153 [72] phi from mulFACbyMEM to prepareMEM [phi:mulFACbyMEM->prepareMEM] + //SEG154 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#3 [phi:mulFACbyMEM->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG155 mulFACbyMEM::@1 + //SEG156 asm { lda$feldy$ffjsr$ba28 } + lda $fe + ldy $ff + jsr $ba28 + //SEG157 mulFACbyMEM::@return + //SEG158 [82] return [ ] ( main:2::mulFACbyMEM:13 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::mulFACbyMEM:23 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG159 sinFAC +sinFAC: { + //SEG160 asm { jsr$e26b } + jsr $e26b + //SEG161 sinFAC::@return + //SEG162 [84] return [ ] ( main:2::sinFAC:21 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG163 divMEMbyFAC +divMEMbyFAC: { + //SEG164 [86] call prepareMEM param-assignment [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG165 [72] phi from divMEMbyFAC to prepareMEM [phi:divMEMbyFAC->prepareMEM] + //SEG166 [72] phi (byte*) prepareMEM::mem#4 = (const byte[]) f_i#0 [phi:divMEMbyFAC->prepareMEM#0] -- zpptrby1=cowo1 + lda #f_i + sta prepareMEM.mem+1 + jsr prepareMEM + //SEG167 divMEMbyFAC::@1 + //SEG168 asm { lda$feldy$ffjsr$bb0f } + lda $fe + ldy $ff + jsr $bb0f + //SEG169 divMEMbyFAC::@return + //SEG170 [88] return [ ] ( main:2::divMEMbyFAC:19 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG171 setFAC +setFAC: { + .const lo = $fe + .const hi = $ff + .label w = 9 + //SEG172 [90] (byte~) setFAC::$0 ← < (word) setFAC::w#3 [ setFAC::w#3 setFAC::$0 ] ( main:2::setFAC:5 [ setFAC::w#3 setFAC::$0 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 setFAC::$0 ] ) -- aby=_lo_zpwo1 + lda w + //SEG173 [91] *((const byte*) setFAC::lo#0) ← (byte~) setFAC::$0 [ setFAC::w#3 ] ( main:2::setFAC:5 [ setFAC::w#3 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::w#3 ] ) -- _deref_cowo1=aby + sta lo + //SEG174 [92] (byte~) setFAC::$1 ← > (word) setFAC::w#3 [ setFAC::$1 ] ( main:2::setFAC:5 [ setFAC::$1 ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 setFAC::$1 ] ) -- aby=_hi_zpwo1 + lda w+1 + //SEG175 [93] *((const byte*) setFAC::hi#0) ← (byte~) setFAC::$1 [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) -- _deref_cowo1=aby + sta hi + //SEG176 asm { ldy$felda$ffjsr$b391 } + ldy $fe + lda $ff + jsr $b391 + //SEG177 setFAC::@return + //SEG178 [95] return [ ] ( main:2::setFAC:5 [ ] main:2::setFAC:11 [ main::i#10 char_cursor#32 line_cursor#13 ] main:2::setFAC:17 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} +//SEG179 setMEMtoFAC +setMEMtoFAC: { + .label mem = 7 + //SEG180 [97] (byte*) prepareMEM::mem#0 ← (byte*) setMEMtoFAC::mem#2 [ prepareMEM::mem#0 ] ( main:2::setMEMtoFAC:7 [ prepareMEM::mem#0 ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 prepareMEM::mem#0 ] ) + // (byte*) prepareMEM::mem#0 = (byte*) setMEMtoFAC::mem#2 // register copy zp ZP_PTR_BYTE:7 + //SEG181 [98] call prepareMEM param-assignment [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + //SEG182 [72] phi from setMEMtoFAC to prepareMEM [phi:setMEMtoFAC->prepareMEM] + //SEG183 [72] phi (byte*) prepareMEM::mem#4 = (byte*) prepareMEM::mem#0 [phi:setMEMtoFAC->prepareMEM#0] -- register_copy + jsr prepareMEM + //SEG184 setMEMtoFAC::@1 + //SEG185 asm { ldx$feldy$ffjsr$bbd4 } + ldx $fe + ldy $ff + jsr $bbd4 + //SEG186 setMEMtoFAC::@return + //SEG187 [100] return [ ] ( main:2::setMEMtoFAC:7 [ ] main:2::setMEMtoFAC:15 [ main::i#10 char_cursor#32 line_cursor#13 ] ) + rts +} + diff --git a/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym new file mode 100644 index 000000000..f7fe3ebb1 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/ref/sinus-basic.sym @@ -0,0 +1,141 @@ +(label) @31 +(label) @begin +(label) @end +(void()) addMEMtoFAC((byte*) addMEMtoFAC::mem) +(label) addMEMtoFAC::@1 +(label) addMEMtoFAC::@return +(byte*) addMEMtoFAC::mem +(byte*) char_cursor +(byte*) char_cursor#10 char_cursor zp ZP_PTR_BYTE:5 5.631578947368422 +(byte*) char_cursor#23 char_cursor zp ZP_PTR_BYTE:5 4.0 +(byte*) char_cursor#31 char_cursor zp ZP_PTR_BYTE:5 1.5 +(byte*) char_cursor#32 char_cursor zp ZP_PTR_BYTE:5 0.52 +(byte*~) char_cursor#49 char_cursor zp ZP_PTR_BYTE:5 22.0 +(void()) divMEMbyFAC((byte*) divMEMbyFAC::mem) +(label) divMEMbyFAC::@1 +(label) divMEMbyFAC::@return +(byte*) divMEMbyFAC::mem +(byte[]) f_127 +(const byte[]) f_127#0 f_127 = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } +(byte*) f_2pi +(const byte*) f_2pi#0 f_2pi = ((byte*))(word) 58085 +(byte[]) f_i +(const byte[]) f_i#0 f_i = { (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0, (byte/signed byte/word/signed word) 0 } +(word()) getFAC() +(label) getFAC::@return +(byte*) getFAC::hi +(const byte*) getFAC::hi#0 hi = ((byte*))(byte/word/signed word) 255 +(byte*) getFAC::lo +(const byte*) getFAC::lo#0 lo = ((byte*))(byte/word/signed word) 254 +(word) getFAC::return +(word) getFAC::return#0 return zp ZP_WORD:9 4.333333333333333 +(word) getFAC::return#2 return zp ZP_WORD:9 22.0 +(word) getFAC::w +(word) getFAC::w#1 w zp ZP_WORD:9 4.0 +(byte[]) hextab +(const byte[]) hextab#0 hextab = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' } +(byte*) line_cursor +(byte*) line_cursor#13 line_cursor zp ZP_PTR_BYTE:3 0.5 +(byte*) line_cursor#6 line_cursor zp ZP_PTR_BYTE:3 204.0 +(void()) main() +(word~) main::$11 $11 zp ZP_WORD:9 22.0 +(word~) main::$2 $2 zp ZP_WORD:9 22.0 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@14 +(label) main::@15 +(label) main::@16 +(label) main::@3 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(label) main::@return +(byte) main::i +(byte) main::i#1 i zp ZP_BYTE:2 11.0 +(byte) main::i#10 i zp ZP_BYTE:2 1.2692307692307692 +(byte*) memHi +(const byte*) memHi#0 memHi = ((byte*))(byte/word/signed word) 255 +(byte*) memLo +(const byte*) memLo#0 memLo = ((byte*))(byte/word/signed word) 254 +(void()) mulFACbyMEM((byte*) mulFACbyMEM::mem) +(label) mulFACbyMEM::@1 +(label) mulFACbyMEM::@return +(byte*) mulFACbyMEM::mem +(byte*) mulFACbyMEM::mem#2 mem zp ZP_PTR_BYTE:7 2.0 +(void()) prepareMEM((byte*) prepareMEM::mem) +(byte~) prepareMEM::$0 reg byte a 4.0 +(byte~) prepareMEM::$1 reg byte a 4.0 +(label) prepareMEM::@return +(byte*) prepareMEM::mem +(byte*) prepareMEM::mem#0 mem zp ZP_PTR_BYTE:7 4.0 +(byte*) prepareMEM::mem#3 mem zp ZP_PTR_BYTE:7 4.0 +(byte*) prepareMEM::mem#4 mem zp ZP_PTR_BYTE:7 2.6666666666666665 +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 reg byte y 4.0 +(byte~) print_byte::$1 reg byte a 4.0 +(byte~) print_byte::$3 reg byte a 4.0 +(byte~) print_byte::$4 reg byte a 4.0 +(label) print_byte::@1 +(label) print_byte::@return +(byte) print_byte::b +(byte) print_byte::b#0 reg byte x 4.0 +(byte) print_byte::b#1 reg byte x 4.0 +(byte) print_byte::b#2 reg byte x 1.6 +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(byte) print_char::ch#0 reg byte a 4.0 +(byte) print_char::ch#1 reg byte a 4.0 +(byte) print_char::ch#2 reg byte a 6.0 +(void()) print_ln() +(byte*~) print_ln::$0 $0 zp ZP_PTR_BYTE:3 46.42857142857143 +(label) print_ln::@1 +(label) print_ln::@return +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 reg byte a 4.0 +(byte~) print_word::$2 reg byte a 4.0 +(label) print_word::@1 +(label) print_word::@return +(word) print_word::w +(word) print_word::w#0 w zp ZP_WORD:9 3.75 +(void()) setFAC((word) setFAC::w) +(byte~) setFAC::$0 reg byte a 4.0 +(byte~) setFAC::$1 reg byte a 4.0 +(label) setFAC::@return +(byte*) setFAC::hi +(const byte*) setFAC::hi#0 hi = ((byte*))(byte/word/signed word) 255 +(byte*) setFAC::lo +(const byte*) setFAC::lo#0 lo = ((byte*))(byte/word/signed word) 254 +(word) setFAC::w +(word) setFAC::w#1 w zp ZP_WORD:9 22.0 +(word) setFAC::w#3 w zp ZP_WORD:9 5.0 +(void()) setMEMtoFAC((byte*) setMEMtoFAC::mem) +(label) setMEMtoFAC::@1 +(label) setMEMtoFAC::@return +(byte*) setMEMtoFAC::mem +(byte*) setMEMtoFAC::mem#2 mem zp ZP_PTR_BYTE:7 2.0 +(void()) sinFAC() +(label) sinFAC::@return + +zp ZP_BYTE:2 [ main::i#10 main::i#1 ] +zp ZP_PTR_BYTE:3 [ line_cursor#6 line_cursor#13 print_ln::$0 ] +reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] +zp ZP_PTR_BYTE:5 [ char_cursor#23 char_cursor#31 char_cursor#32 char_cursor#49 char_cursor#10 ] +zp ZP_PTR_BYTE:7 [ prepareMEM::mem#4 prepareMEM::mem#3 prepareMEM::mem#0 mulFACbyMEM::mem#2 setMEMtoFAC::mem#2 ] +zp ZP_WORD:9 [ setFAC::w#3 setFAC::w#1 main::$2 getFAC::return#2 main::$11 print_word::w#0 getFAC::w#1 getFAC::return#0 ] +reg byte a [ print_word::$0 ] +reg byte a [ print_word::$2 ] +reg byte y [ print_byte::$0 ] +reg byte a [ print_byte::$1 ] +reg byte a [ print_byte::$3 ] +reg byte a [ print_byte::$4 ] +reg byte a [ prepareMEM::$0 ] +reg byte a [ prepareMEM::$1 ] +reg byte a [ setFAC::$0 ] +reg byte a [ setFAC::$1 ] diff --git a/src/main/java/dk/camelot64/kickc/test/sinus-basic.kc b/src/main/java/dk/camelot64/kickc/test/sinus-basic.kc new file mode 100644 index 000000000..79da8cbbd --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/sinus-basic.kc @@ -0,0 +1,23 @@ +import "print" +import "basic-floats" + +byte[] f_i = {0, 0, 0, 0, 0}; +byte[] f_127 = {0, 0, 0, 0, 0}; +byte* f_2pi = $e2e5; + +void main() { + setFAC(127); + setMEMtoFAC(f_127); + for(byte i : 1..25) { + setFAC((word)i); + mulFACbyMEM(f_2pi); + setMEMtoFAC(f_i); + setFAC(25); + divMEMbyFAC(f_i); + sinFAC(); + mulFACbyMEM(f_127); + addMEMtoFAC(f_127); + print_word(getFAC()); + print_ln(); + } +}