Resolving sizeof() (byte~) main::$0 ← sizeof  (struct Point) main::p
Resolving sizeof() (byte~) main::$2 ← sizeof  (struct Circle) main::c
Created struct value member variable (byte) main::p_x
Created struct value member variable (byte) main::p_y
Converted struct value to member variables (struct Point) main::p
Created struct value member variable (struct Point) main::c_center
Created struct value member variable (byte) main::c_radius
Converted struct value to member variables (struct Circle) main::c
Adding struct value member variable default initializer (byte) main::p_x ← (byte) 0
Adding struct value member variable default initializer (byte) main::p_y ← (byte) 0
Adding struct value member variable default initializer (struct Point) main::c_center ← {}
Adding struct value member variable default initializer (byte) main::c_radius ← (byte) 0
Created struct value member variable (byte) main::c_center_x
Created struct value member variable (byte) main::c_center_y
Converted struct value to member variables (struct Point) main::c_center
Adding struct value member variable default initializer (byte) main::c_center_x ← (byte) 0
Adding struct value member variable default initializer (byte) main::c_center_y ← (byte) 0
Identified constant variable (byte) main::p_x
Identified constant variable (byte) main::p_y
Identified constant variable (byte) main::c_radius
Identified constant variable (byte) main::c_center_x
Identified constant variable (byte) main::c_center_y

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) SCREEN#0 ← ((byte*)) (number) $400
  to:@1
main: scope:[main]  from @1
  (byte) main::idx#0 ← (number) 0
  *((byte*) SCREEN#0 + (byte) main::idx#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT
  (byte) main::idx#1 ← ++ (byte) main::idx#0
  *((byte*) SCREEN#0 + (byte) main::idx#1) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE
  (byte) main::idx#2 ← ++ (byte) main::idx#1
  (byte) main::idx#3 ← ++ (byte) main::idx#2
  (byte~) main::$0 ← (const byte) SIZEOF_STRUCT_POINT
  (byte~) main::$1 ← (byte) '0' + (byte~) main::$0
  *((byte*) SCREEN#0 + (byte) main::idx#3) ← (byte~) main::$1
  (byte) main::idx#4 ← ++ (byte) main::idx#3
  (byte~) main::$2 ← (const byte) SIZEOF_STRUCT_CIRCLE
  (byte~) main::$3 ← (byte) '0' + (byte~) main::$2
  *((byte*) SCREEN#0 + (byte) main::idx#4) ← (byte~) main::$3
  (byte) main::idx#5 ← ++ (byte) main::idx#4
  (byte) main::idx#6 ← ++ (byte) main::idx#5
  (byte) main::NUM_POINTS#0 ← (number) 4
  (struct Point[main::NUM_POINTS#0]) main::points#0 ← { fill( main::NUM_POINTS#0, 0) }
  (byte~) main::$4 ← sizeof  (struct Point[main::NUM_POINTS#0]) main::points#0
  (byte~) main::$5 ← (byte) '0' + (byte~) main::$4
  *((byte*) SCREEN#0 + (byte) main::idx#6) ← (byte~) main::$5
  (byte) main::idx#7 ← ++ (byte) main::idx#6
  (byte~) main::$6 ← sizeof  (struct Point[main::NUM_POINTS#0]) main::points#0
  (byte~) main::$7 ← (byte~) main::$6 / (const byte) SIZEOF_STRUCT_POINT
  (byte~) main::$8 ← (byte) '0' + (byte~) main::$7
  *((byte*) SCREEN#0 + (byte) main::idx#7) ← (byte~) main::$8
  (byte) main::idx#8 ← ++ (byte) main::idx#7
  (number~) main::$9 ← (byte) main::NUM_POINTS#0 - (number) 1
  (byte) main::NUM_CIRCLES#0 ← (number~) main::$9
  (struct Circle[main::NUM_CIRCLES#0]) main::circles#0 ← { fill( main::NUM_CIRCLES#0, 0) }
  (byte~) main::$10 ← sizeof  (struct Circle[main::NUM_CIRCLES#0]) main::circles#0
  (byte~) main::$11 ← (byte) '0' + (byte~) main::$10
  *((byte*) SCREEN#0 + (byte) main::idx#8) ← (byte~) main::$11
  (byte) main::idx#9 ← ++ (byte) main::idx#8
  (byte~) main::$12 ← sizeof  (struct Circle[main::NUM_CIRCLES#0]) main::circles#0
  (byte~) main::$13 ← (byte~) main::$12 / (const byte) SIZEOF_STRUCT_CIRCLE
  (byte~) main::$14 ← (byte) '0' + (byte~) main::$13
  *((byte*) SCREEN#0 + (byte) main::idx#9) ← (byte~) main::$14
  (byte) main::idx#10 ← ++ (byte) main::idx#9
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(struct Point) Circle::center
(byte) Circle::radius
(byte) Point::x
(byte) Point::y
(byte*) SCREEN
(byte*) SCREEN#0
(const byte) SIZEOF_STRUCT_CIRCLE = (byte) 3
(const byte) SIZEOF_STRUCT_POINT = (byte) 2
(void()) main()
(byte~) main::$0
(byte~) main::$1
(byte~) main::$10
(byte~) main::$11
(byte~) main::$12
(byte~) main::$13
(byte~) main::$14
(byte~) main::$2
(byte~) main::$3
(byte~) main::$4
(byte~) main::$5
(byte~) main::$6
(byte~) main::$7
(byte~) main::$8
(number~) main::$9
(label) main::@return
(byte) main::NUM_CIRCLES
(byte) main::NUM_CIRCLES#0
(byte) main::NUM_POINTS
(byte) main::NUM_POINTS#0
(struct Circle[main::NUM_CIRCLES#0]) main::circles
(struct Circle[main::NUM_CIRCLES#0]) main::circles#0
(byte) main::idx
(byte) main::idx#0
(byte) main::idx#1
(byte) main::idx#10
(byte) main::idx#2
(byte) main::idx#3
(byte) main::idx#4
(byte) main::idx#5
(byte) main::idx#6
(byte) main::idx#7
(byte) main::idx#8
(byte) main::idx#9
(struct Point[main::NUM_POINTS#0]) main::points
(struct Point[main::NUM_POINTS#0]) main::points#0

Adding number conversion cast (unumber) 0 in (byte) main::idx#0 ← (number) 0
Adding number conversion cast (unumber) 4 in (byte) main::NUM_POINTS#0 ← (number) 4
Adding number conversion cast (unumber) 1 in (number~) main::$9 ← (byte) main::NUM_POINTS#0 - (number) 1
Adding number conversion cast (unumber) main::$9 in (number~) main::$9 ← (byte) main::NUM_POINTS#0 - (unumber)(number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::idx#0 ← (unumber)(number) 0
Inlining cast (byte) main::NUM_POINTS#0 ← (unumber)(number) 4
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 4
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$9 ← (byte) main::NUM_POINTS#0 - (byte) 1
Alias (byte) main::NUM_CIRCLES#0 = (byte~) main::$9 
Successful SSA optimization Pass2AliasElimination
Identified duplicate assignment right side [22] (byte~) main::$6 ← sizeof  (struct Point[main::NUM_POINTS#0]) main::points#0
Identified duplicate assignment right side [34] (byte~) main::$12 ← sizeof  (struct Circle[main::NUM_CIRCLES#0]) main::circles#0
Successful SSA optimization Pass2DuplicateRValueIdentification
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte) main::idx#0 = 0
Constant (const byte) main::$0 = SIZEOF_STRUCT_POINT
Constant (const byte) main::$2 = SIZEOF_STRUCT_CIRCLE
Constant (const byte) main::NUM_POINTS#0 = 4
Successful SSA optimization Pass2ConstantIdentification
Constant value identified { fill( main::NUM_POINTS#0, 0) } in [17] (struct Point[main::NUM_POINTS#0]) main::points#0 ← { fill( main::NUM_POINTS#0, 0) }
Successful SSA optimization Pass2ConstantValues
Simplifying expression containing zero SCREEN#0 in [2] *((const byte*) SCREEN#0 + (const byte) main::idx#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#10 and assignment [32] (byte) main::idx#10 ← ++ (byte) main::idx#9
Successful SSA optimization PassNEliminateUnusedVars
Alias (byte~) main::$6 = (byte~) main::$4 
Alias (byte~) main::$12 = (byte~) main::$10 
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] (byte) main::idx#1 ← ++ (const byte) main::idx#0
Constant right-side identified [5] (byte~) main::$1 ← (byte) '0' + (const byte) main::$0
Constant right-side identified [8] (byte~) main::$3 ← (byte) '0' + (const byte) main::$2
Constant right-side identified [22] (byte) main::NUM_CIRCLES#0 ← (const byte) main::NUM_POINTS#0 - (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#1 = ++main::idx#0
Constant (const byte) main::$1 = '0'+main::$0
Constant (const byte) main::$3 = '0'+main::$2
Constant (const struct Point[main::NUM_POINTS#0]) main::points#0 = { fill( main::NUM_POINTS#0, 0) }
Constant (const byte) main::NUM_CIRCLES#0 = main::NUM_POINTS#0-1
Successful SSA optimization Pass2ConstantIdentification
Constant value identified { fill( main::NUM_CIRCLES#0, 0) } in [23] (struct Circle[main::NUM_CIRCLES#0]) main::circles#0 ← { fill( main::NUM_CIRCLES#0, 0) }
Successful SSA optimization Pass2ConstantValues
Constant right-side identified [2] (byte) main::idx#2 ← ++ (const byte) main::idx#1
Constant right-side identified [9] (byte~) main::$6 ← sizeof  (const struct Point[main::NUM_POINTS#0]) main::points#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#2 = ++main::idx#1
Constant (const byte) main::$6 = sizeof main::points#0
Constant (const struct Circle[main::NUM_CIRCLES#0]) main::circles#0 = { fill( main::NUM_CIRCLES#0, 0) }
Successful SSA optimization Pass2ConstantIdentification
Resolving array sizeof() sizeof (const struct Point[main::NUM_POINTS#0]) main::points#0
Successful SSA optimization PassNSizeOfSimplification
Constant right-side identified [2] (byte) main::idx#3 ← ++ (const byte) main::idx#2
Constant right-side identified [8] (byte~) main::$5 ← (byte) '0' + (const byte) main::$6
Constant right-side identified [11] (byte~) main::$7 ← (const byte) main::$6 / (const byte) SIZEOF_STRUCT_POINT
Constant right-side identified [15] (byte~) main::$12 ← sizeof  (const struct Circle[main::NUM_CIRCLES#0]) main::circles#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#3 = ++main::idx#2
Constant (const byte) main::$5 = '0'+main::$6
Constant (const byte) main::$7 = main::$6/SIZEOF_STRUCT_POINT
Constant (const byte) main::$12 = sizeof main::circles#0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const struct Point[main::NUM_POINTS#0]) main::points#0
Successful SSA optimization PassNEliminateUnusedVars
Resolving array sizeof() sizeof (const struct Circle[main::NUM_CIRCLES#0]) main::circles#0
Successful SSA optimization PassNSizeOfSimplification
Constant right-side identified [3] (byte) main::idx#4 ← ++ (const byte) main::idx#3
Constant right-side identified [9] (byte~) main::$8 ← (byte) '0' + (const byte) main::$7
Constant right-side identified [12] (byte~) main::$11 ← (byte) '0' + (const byte) main::$12
Constant right-side identified [15] (byte~) main::$13 ← (const byte) main::$12 / (const byte) SIZEOF_STRUCT_CIRCLE
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#4 = ++main::idx#3
Constant (const byte) main::$8 = '0'+main::$7
Constant (const byte) main::$11 = '0'+main::$12
Constant (const byte) main::$13 = main::$12/SIZEOF_STRUCT_CIRCLE
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const struct Circle[main::NUM_CIRCLES#0]) main::circles#0
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [4] (byte) main::idx#5 ← ++ (const byte) main::idx#4
Constant right-side identified [12] (byte~) main::$14 ← (byte) '0' + (const byte) main::$13
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#5 = ++main::idx#4
Constant (const byte) main::$14 = '0'+main::$13
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [4] (byte) main::idx#6 ← ++ (const byte) main::idx#5
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#6 = ++main::idx#5
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [5] (byte) main::idx#7 ← ++ (const byte) main::idx#6
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#7 = ++main::idx#6
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [6] (byte) main::idx#8 ← ++ (const byte) main::idx#7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#8 = ++main::idx#7
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [7] (byte) main::idx#9 ← ++ (const byte) main::idx#8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#9 = ++main::idx#8
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const byte) main::idx#0
Inlining constant with different constant siblings (const byte) main::idx#1
Inlining constant with different constant siblings (const byte) main::idx#2
Inlining constant with different constant siblings (const byte) main::idx#3
Inlining constant with different constant siblings (const byte) main::idx#4
Inlining constant with different constant siblings (const byte) main::idx#5
Inlining constant with different constant siblings (const byte) main::idx#6
Inlining constant with different constant siblings (const byte) main::idx#7
Inlining constant with different constant siblings (const byte) main::idx#8
Inlining constant with different constant siblings (const byte) main::idx#9
Constant inlined main::$12 = (const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE
Constant inlined main::$13 = (const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE
Constant inlined main::$14 = (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE
Constant inlined main::$11 = (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE
Constant inlined main::idx#0 = (byte) 0
Constant inlined main::idx#1 = ++(byte) 0
Constant inlined main::idx#2 = ++++(byte) 0
Constant inlined main::$1 = (byte) '0'+(const byte) SIZEOF_STRUCT_POINT
Constant inlined main::idx#3 = ++++++(byte) 0
Constant inlined main::$2 = (const byte) SIZEOF_STRUCT_CIRCLE
Constant inlined main::idx#4 = ++++++++(byte) 0
Constant inlined main::idx#5 = ++++++++++(byte) 0
Constant inlined main::$0 = (const byte) SIZEOF_STRUCT_POINT
Constant inlined main::idx#6 = ++++++++++++(byte) 0
Constant inlined main::$5 = (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT
Constant inlined main::idx#7 = ++++++++++++++(byte) 0
Constant inlined main::$6 = (const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT
Constant inlined main::idx#8 = ++++++++++++++++(byte) 0
Constant inlined main::$3 = (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE
Constant inlined main::idx#9 = ++++++++++++++++++(byte) 0
Constant inlined main::$7 = (const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT
Constant inlined main::$8 = (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN#0+++0)
Consolidated array index constant in *(SCREEN#0+++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++++++++0)
Successful SSA optimization Pass2ConstantAdditionElimination
Simplifying constant integer increment ++0
Simplifying constant integer increment ++0
Simplifying constant integer increment ++1
Simplifying constant integer increment ++2
Simplifying constant integer increment ++3
Simplifying constant integer increment ++4
Simplifying constant integer increment ++5
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++2
Simplifying constant integer increment ++3
Simplifying constant integer increment ++5
Simplifying constant integer increment ++6
Simplifying constant integer increment ++6
Simplifying constant integer increment ++7
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++7
Simplifying constant integer increment ++8
Successful SSA optimization Pass2ConstantSimplification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2 

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT
  [5] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE
  [6] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT
  [7] *((const byte*) SCREEN#0+(byte) 4) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE
  [8] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT
  [9] *((const byte*) SCREEN#0+(byte) 7) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT
  [10] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE
  [11] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE
  to:main::@return
main::@return: scope:[main]  from main
  [12] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(struct Point) Circle::center
(byte) Circle::radius
(byte) Point::x
(byte) Point::y
(byte*) SCREEN
(void()) main()
(byte) main::NUM_CIRCLES
(byte) main::NUM_POINTS
(struct Circle[main::NUM_CIRCLES#0]) main::circles
(byte) main::idx
(struct Point[main::NUM_POINTS#0]) main::points

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
  // File Comments
// Tests the sizeof() operator on structs
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_STRUCT_POINT = 2
  .const SIZEOF_STRUCT_CIRCLE = 3
  .label SCREEN = $400
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // Struct Arrays
    .const NUM_POINTS = 4
    .const NUM_CIRCLES = NUM_POINTS-1
    // [4] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    // Struct Types
    lda #'0'+SIZEOF_STRUCT_POINT
    sta SCREEN
    // [5] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_CIRCLE
    sta SCREEN+1
    // [6] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_POINT
    sta SCREEN+3
    // [7] *((const byte*) SCREEN#0+(byte) 4) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_CIRCLE
    sta SCREEN+4
    // [8] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_POINTS*SIZEOF_STRUCT_POINT
    sta SCREEN+6
    // [9] *((const byte*) SCREEN#0+(byte) 7) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_POINTS*SIZEOF_STRUCT_POINT/SIZEOF_STRUCT_POINT
    sta SCREEN+7
    // [10] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_CIRCLES*SIZEOF_STRUCT_CIRCLE
    sta SCREEN+8
    // [11] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_CIRCLES*SIZEOF_STRUCT_CIRCLE/SIZEOF_STRUCT_CIRCLE
    sta SCREEN+9
    jmp breturn
    // main::@return
  breturn:
    // [12] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) SCREEN#0+(byte) 4) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [9] *((const byte*) SCREEN#0+(byte) 7) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [10] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE [ ] ( main:2 [ ] ) always clobbers reg byte a 

REGISTER UPLIFT SCOPES
Uplift Scope [Point] 
Uplift Scope [Circle] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [Point] best 69 combination 
Uplifting [Circle] best 69 combination 
Uplifting [main] best 69 combination 
Uplifting [] best 69 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests the sizeof() operator on structs
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_STRUCT_POINT = 2
  .const SIZEOF_STRUCT_CIRCLE = 3
  .label SCREEN = $400
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // Struct Arrays
    .const NUM_POINTS = 4
    .const NUM_CIRCLES = NUM_POINTS-1
    // [4] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    // Struct Types
    lda #'0'+SIZEOF_STRUCT_POINT
    sta SCREEN
    // [5] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_CIRCLE
    sta SCREEN+1
    // [6] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_POINT
    sta SCREEN+3
    // [7] *((const byte*) SCREEN#0+(byte) 4) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_CIRCLE
    sta SCREEN+4
    // [8] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_POINTS*SIZEOF_STRUCT_POINT
    sta SCREEN+6
    // [9] *((const byte*) SCREEN#0+(byte) 7) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_POINTS*SIZEOF_STRUCT_POINT/SIZEOF_STRUCT_POINT
    sta SCREEN+7
    // [10] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_CIRCLES*SIZEOF_STRUCT_CIRCLE
    sta SCREEN+8
    // [11] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_CIRCLES*SIZEOF_STRUCT_CIRCLE/SIZEOF_STRUCT_CIRCLE
    sta SCREEN+9
    jmp breturn
    // main::@return
  breturn:
    // [12] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction bend_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(struct Point) Circle::center
(byte) Circle::radius
(byte) Point::x
(byte) Point::y
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(const byte) SIZEOF_STRUCT_CIRCLE SIZEOF_STRUCT_CIRCLE = (byte) 3
(const byte) SIZEOF_STRUCT_POINT SIZEOF_STRUCT_POINT = (byte) 2
(void()) main()
(label) main::@return
(byte) main::NUM_CIRCLES
(const byte) main::NUM_CIRCLES#0 NUM_CIRCLES = (const byte) main::NUM_POINTS#0-(byte) 1
(byte) main::NUM_POINTS
(const byte) main::NUM_POINTS#0 NUM_POINTS = (byte) 4
(struct Circle[main::NUM_CIRCLES#0]) main::circles
(byte) main::idx
(struct Point[main::NUM_POINTS#0]) main::points



FINAL ASSEMBLER
Score: 54

  // File Comments
// Tests the sizeof() operator on structs
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_STRUCT_POINT = 2
  .const SIZEOF_STRUCT_CIRCLE = 3
  .label SCREEN = $400
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // Struct Arrays
    .const NUM_POINTS = 4
    .const NUM_CIRCLES = NUM_POINTS-1
    // SCREEN[idx++] = '0'+sizeof(struct Point)
    // [4] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    // Struct Types
    lda #'0'+SIZEOF_STRUCT_POINT
    sta SCREEN
    // SCREEN[idx++] = '0'+sizeof(struct Circle)
    // [5] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_CIRCLE
    sta SCREEN+1
    // SCREEN[idx++] = '0'+sizeof(p)
    // [6] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_POINT
    sta SCREEN+3
    // SCREEN[idx++] = '0'+sizeof(c)
    // [7] *((const byte*) SCREEN#0+(byte) 4) ← (byte) '0'+(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_STRUCT_CIRCLE
    sta SCREEN+4
    // SCREEN[idx++] = '0'+sizeof(points)
    // [8] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_POINTS*SIZEOF_STRUCT_POINT
    sta SCREEN+6
    // SCREEN[idx++] = '0'+sizeof(points)/sizeof(struct Point)
    // [9] *((const byte*) SCREEN#0+(byte) 7) ← (byte) '0'+(const byte) main::NUM_POINTS#0*(const byte) SIZEOF_STRUCT_POINT/(const byte) SIZEOF_STRUCT_POINT -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_POINTS*SIZEOF_STRUCT_POINT/SIZEOF_STRUCT_POINT
    sta SCREEN+7
    // SCREEN[idx++] = '0'+sizeof(circles)
    // [10] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_CIRCLES*SIZEOF_STRUCT_CIRCLE
    sta SCREEN+8
    // SCREEN[idx++] = '0'+sizeof(circles)/sizeof(struct Circle)
    // [11] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) main::NUM_CIRCLES#0*(const byte) SIZEOF_STRUCT_CIRCLE/(const byte) SIZEOF_STRUCT_CIRCLE -- _deref_pbuc1=vbuc2 
    lda #'0'+NUM_CIRCLES*SIZEOF_STRUCT_CIRCLE/SIZEOF_STRUCT_CIRCLE
    sta SCREEN+9
    // main::@return
    // }
    // [12] return 
    rts
}
  // File Data

