Eliminating unused variable with no statement main::$0
Eliminating unused variable with no statement main::$5

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  main::i#0 = 0
  to:main::@1
main::@1: scope:[main]  from main main::@1
  main::i#2 = phi( main/main::i#0, main::@1/main::i#1 )
  main::$9 = main::i#2 * SIZEOF_STRUCT_POINT
  main::point_i#0 = points + main::$9
  main::$11 = (char *)main::point_i#0
  main::$1 = main::$11 + OFFS_X
  *main::$1 = main::i#2
  main::$12 = (char *)main::point_i#0
  main::$2 = main::$12 + OFFS_Y
  main::$3 = main::i#2 + 4
  *main::$2 = main::$3
  main::i#1 = main::i#2 + rangenext(0,3)
  main::$4 = main::i#1 != rangelast(0,3)
  if(main::$4) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  main::i1#0 = 0
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  main::i1#2 = phi( main::@2/main::i1#0, main::@3/main::i1#1 )
  main::$10 = main::i1#2 * SIZEOF_STRUCT_POINT
  main::point_i1#0 = points + main::$10
  main::$13 = (char *)main::point_i1#0
  main::$6 = main::$13 + OFFS_X
  main::SCREEN[main::i1#2] = *main::$6
  main::$14 = (char *)main::point_i1#0
  main::$7 = main::$14 + OFFS_Y
  (main::SCREEN+$28)[main::i1#2] = *main::$7
  main::i1#1 = main::i1#2 + rangenext(0,3)
  main::$8 = main::i1#1 != rangelast(0,3)
  if(main::$8) goto main::@3
  to:main::@return
main::@return: scope:[main]  from main::@3
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  call main
  to:__start::@1
__start::@1: scope:[__start]  from __start
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  return 
  to:@return

SYMBOL TABLE SSA
__constant const char OFFS_X = 0
__constant const char OFFS_Y = 1
__constant char SIZEOF_STRUCT_POINT = 2
void __start()
void main()
char *main::$1
char main::$10
char *main::$11
char *main::$12
char *main::$13
char *main::$14
char *main::$2
number main::$3
bool main::$4
char *main::$6
char *main::$7
bool main::$8
char main::$9
__constant char * const main::SCREEN = (char *)$400
char main::i
char main::i#0
char main::i#1
char main::i#2
char main::i1
char main::i1#0
char main::i1#1
char main::i1#2
struct Point *main::point_i
struct Point *main::point_i#0
struct Point *main::point_i1
struct Point *main::point_i1#0
__constant struct Point points[4] = { fill( 4, 0) }

Adding number conversion cast (unumber) 4 in main::$3 = main::i#2 + 4
Adding number conversion cast (unumber) main::$3 in main::$3 = main::i#2 + (unumber)4
Adding number conversion cast (unumber) $28 in (main::SCREEN+$28)[main::i1#2] = *main::$7
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 4
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to char in main::$3 = main::i#2 + 4
Simple Condition main::$4 [13] if(main::i#1!=rangelast(0,3)) goto main::@1
Simple Condition main::$8 [26] if(main::i1#1!=rangelast(0,3)) goto main::@3
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant main::i#0 = 0
Constant main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [11] main::i#1 = ++ main::i#2 to ++
Resolved ranged comparison value [13] if(main::i#1!=rangelast(0,3)) goto main::@1 to 4
Resolved ranged next value [24] main::i1#1 = ++ main::i1#2 to ++
Resolved ranged comparison value [26] if(main::i1#1!=rangelast(0,3)) goto main::@3 to 4
Converting *(pointer+n) to pointer[n] [6] *main::$1 = main::i#2  -- main::$11[OFFS_X]
Converting *(pointer+n) to pointer[n] [10] *main::$2 = main::$3  -- main::$12[OFFS_Y]
Converting *(pointer+n) to pointer[n] [20] main::SCREEN[main::i1#2] = *main::$6  -- main::$13[OFFS_X]
Converting *(pointer+n) to pointer[n] [23] (main::SCREEN+$28)[main::i1#2] = *main::$7  -- main::$14[OFFS_Y]
Successful SSA optimization Pass2InlineDerefIdx
Simplifying expression containing zero main::$11 in [5] main::$1 = main::$11 + OFFS_X
Simplifying expression containing zero main::$11 in [6] main::$11[OFFS_X] = main::i#2
Simplifying expression containing zero main::$13 in [19] main::$6 = main::$13 + OFFS_X
Simplifying expression containing zero main::$13 in [20] main::SCREEN[main::i1#2] = main::$13[OFFS_X]
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable main::$1 and assignment [4] main::$1 = main::$11
Eliminating unused variable main::$2 and assignment [7] main::$2 = main::$12 + OFFS_Y
Eliminating unused variable main::$6 and assignment [16] main::$6 = main::$13
Eliminating unused variable main::$7 and assignment [19] main::$7 = main::$14 + OFFS_Y
Eliminating unused constant OFFS_X
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Adding number conversion cast (unumber) 4 in [9] if(main::i#1!=4) goto main::@1
Adding number conversion cast (unumber) 4 in [18] if(main::i1#1!=4) goto main::@3
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) 4
Successful SSA optimization PassNFinalizeNumberTypeConversions
Converting *(pointer+n) to pointer[n] [4] *main::$11 = main::i#2  -- ((char *)points)[main::$9]
Converting *(pointer+n) to pointer[n] [14] main::SCREEN[main::i1#2] = *main::$13  -- ((char *)points)[main::$10]
Successful SSA optimization Pass2InlineDerefIdx
Eliminating unused variable main::$11 and assignment [3] main::$11 = (char *)main::point_i#0
Eliminating unused variable main::$13 and assignment [13] main::$13 = (char *)main::point_i1#0
Successful SSA optimization PassNEliminateUnusedVars
Constant value identified (char *)points in [3] ((char *)points)[main::$9] = main::i#2
Constant value identified (char *)points in [12] main::SCREEN[main::i1#2] = ((char *)points)[main::$10]
Successful SSA optimization Pass2ConstantValues
Inlining Noop Cast [4] main::$12 = (char *)main::point_i#0 keeping main::point_i#0
Inlining Noop Cast [13] main::$14 = (char *)main::point_i1#0 keeping main::point_i1#0
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [1] main::$9 = main::i#2 * SIZEOF_STRUCT_POINT
Rewriting multiplication to use shift [10] main::$10 = main::i1#2 * SIZEOF_STRUCT_POINT
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings main::i#0
Inlining constant with var siblings main::i1#0
Constant inlined main::i#0 = 0
Constant inlined main::i1#0 = 0
Successful SSA optimization Pass2ConstantInlining
Eliminating unused constant SIZEOF_STRUCT_POINT
Successful SSA optimization PassNEliminateUnusedVars
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) 4
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting main::@4(between main::@1 and main::@1)
Added new block during phi lifting main::@5(between main::@3 and main::@3)
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
CALL GRAPH

Created 2 initial phi equivalence classes
Coalesced [18] main::i1#3 = main::i1#1
Coalesced [19] main::i#3 = main::i#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block label main::@2
Culled Empty Block label main::@5
Culled Empty Block label main::@4
Renumbering block main::@3 to main::@2
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [1] main::i#2 = phi( main/0, main::@1/main::i#1 )
  [2] main::$9 = main::i#2 << 1
  [3] main::point_i#0 = points + main::$9
  [4] ((char *)points)[main::$9] = main::i#2
  [5] main::$3 = main::i#2 + 4
  [6] ((char *)main::point_i#0)[OFFS_Y] = main::$3
  [7] main::i#1 = ++ main::i#2
  [8] if(main::i#1!=4) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  [9] main::i1#2 = phi( main::@1/0, main::@2/main::i1#1 )
  [10] main::$10 = main::i1#2 << 1
  [11] main::point_i1#0 = points + main::$10
  [12] main::SCREEN[main::i1#2] = ((char *)points)[main::$10]
  [13] (main::SCREEN+$28)[main::i1#2] = ((char *)main::point_i1#0)[OFFS_Y]
  [14] main::i1#1 = ++ main::i1#2
  [15] if(main::i1#1!=4) goto main::@2
  to:main::@return
main::@return: scope:[main]  from main::@2
  [16] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()
char main::$10 // 16.5
char main::$3 // 22.0
char main::$9 // 16.5
char main::i
char main::i#1 // 16.5
char main::i#2 // 9.166666666666666
char main::i1
char main::i1#1 // 16.5
char main::i1#2 // 11.0
struct Point *main::point_i
struct Point *main::point_i#0 // 3.6666666666666665
struct Point *main::point_i1
struct Point *main::point_i1#0 // 5.5

Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ main::i1#2 main::i1#1 ]
Added variable main::$9 to live range equivalence class [ main::$9 ]
Added variable main::point_i#0 to live range equivalence class [ main::point_i#0 ]
Added variable main::$3 to live range equivalence class [ main::$3 ]
Added variable main::$10 to live range equivalence class [ main::$10 ]
Added variable main::point_i1#0 to live range equivalence class [ main::point_i1#0 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::i1#2 main::i1#1 ]
[ main::$9 ]
[ main::point_i#0 ]
[ main::$3 ]
[ main::$10 ]
[ main::point_i1#0 ]
Allocated zp[1]:2 [ main::i1#2 main::i1#1 ]
Allocated zp[1]:3 [ main::i#2 main::i#1 ]
Allocated zp[1]:4 [ main::$3 ]
Allocated zp[1]:5 [ main::$9 ]
Allocated zp[1]:6 [ main::$10 ]
Allocated zp[2]:7 [ main::point_i1#0 ]
Allocated zp[2]:9 [ main::point_i#0 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [2] main::$9 = main::i#2 << 1 [ main::i#2 main::$9 ] (  [ main::i#2 main::$9 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::i#2 main::i#1 ]
Statement [3] main::point_i#0 = points + main::$9 [ main::i#2 main::$9 main::point_i#0 ] (  [ main::i#2 main::$9 main::point_i#0 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::$9 ]
Statement [4] ((char *)points)[main::$9] = main::i#2 [ main::i#2 main::point_i#0 ] (  [ main::i#2 main::point_i#0 ] { }  ) always clobbers reg byte a 
Statement [5] main::$3 = main::i#2 + 4 [ main::i#2 main::point_i#0 main::$3 ] (  [ main::i#2 main::point_i#0 main::$3 ] { }  ) always clobbers reg byte a 
Statement [6] ((char *)main::point_i#0)[OFFS_Y] = main::$3 [ main::i#2 ] (  [ main::i#2 ] { }  ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::i#2 main::i#1 ]
Statement [10] main::$10 = main::i1#2 << 1 [ main::i1#2 main::$10 ] (  [ main::i1#2 main::$10 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i1#2 main::i1#1 ]
Statement [11] main::point_i1#0 = points + main::$10 [ main::i1#2 main::$10 main::point_i1#0 ] (  [ main::i1#2 main::$10 main::point_i1#0 ] { }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:6 [ main::$10 ]
Statement [12] main::SCREEN[main::i1#2] = ((char *)points)[main::$10] [ main::i1#2 main::point_i1#0 ] (  [ main::i1#2 main::point_i1#0 ] { }  ) always clobbers reg byte a 
Statement [13] (main::SCREEN+$28)[main::i1#2] = ((char *)main::point_i1#0)[OFFS_Y] [ main::i1#2 ] (  [ main::i1#2 ] { }  ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::i1#2 main::i1#1 ]
Statement [2] main::$9 = main::i#2 << 1 [ main::i#2 main::$9 ] (  [ main::i#2 main::$9 ] { }  ) always clobbers reg byte a 
Statement [3] main::point_i#0 = points + main::$9 [ main::i#2 main::$9 main::point_i#0 ] (  [ main::i#2 main::$9 main::point_i#0 ] { }  ) always clobbers reg byte a 
Statement [4] ((char *)points)[main::$9] = main::i#2 [ main::i#2 main::point_i#0 ] (  [ main::i#2 main::point_i#0 ] { }  ) always clobbers reg byte a 
Statement [5] main::$3 = main::i#2 + 4 [ main::i#2 main::point_i#0 main::$3 ] (  [ main::i#2 main::point_i#0 main::$3 ] { }  ) always clobbers reg byte a 
Statement [6] ((char *)main::point_i#0)[OFFS_Y] = main::$3 [ main::i#2 ] (  [ main::i#2 ] { }  ) always clobbers reg byte y 
Statement [10] main::$10 = main::i1#2 << 1 [ main::i1#2 main::$10 ] (  [ main::i1#2 main::$10 ] { }  ) always clobbers reg byte a 
Statement [11] main::point_i1#0 = points + main::$10 [ main::i1#2 main::$10 main::point_i1#0 ] (  [ main::i1#2 main::$10 main::point_i1#0 ] { }  ) always clobbers reg byte a 
Statement [12] main::SCREEN[main::i1#2] = ((char *)points)[main::$10] [ main::i1#2 main::point_i1#0 ] (  [ main::i1#2 main::point_i1#0 ] { }  ) always clobbers reg byte a 
Statement [13] (main::SCREEN+$28)[main::i1#2] = ((char *)main::point_i1#0)[OFFS_Y] [ main::i1#2 ] (  [ main::i1#2 ] { }  ) always clobbers reg byte a reg byte y 
Potential registers zp[1]:3 [ main::i#2 main::i#1 ] : zp[1]:3 , reg byte x , 
Potential registers zp[1]:2 [ main::i1#2 main::i1#1 ] : zp[1]:2 , reg byte x , 
Potential registers zp[1]:5 [ main::$9 ] : zp[1]:5 , reg byte x , reg byte y , 
Potential registers zp[2]:9 [ main::point_i#0 ] : zp[2]:9 , 
Potential registers zp[1]:4 [ main::$3 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ main::$10 ] : zp[1]:6 , reg byte x , reg byte y , 
Potential registers zp[2]:7 [ main::point_i1#0 ] : zp[2]:7 , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp[1]:2 [ main::i1#2 main::i1#1 ] 25.67: zp[1]:3 [ main::i#2 main::i#1 ] 22: zp[1]:4 [ main::$3 ] 16.5: zp[1]:5 [ main::$9 ] 16.5: zp[1]:6 [ main::$10 ] 5.5: zp[2]:7 [ main::point_i1#0 ] 3.67: zp[2]:9 [ main::point_i#0 ] 
Uplift Scope [Point] 
Uplift Scope [] 

Uplifting [main] best 1246 combination reg byte x [ main::i1#2 main::i1#1 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$3 ] reg byte y [ main::$9 ] zp[1]:6 [ main::$10 ] zp[2]:7 [ main::point_i1#0 ] zp[2]:9 [ main::point_i#0 ] 
Limited combination testing to 100 combinations of 144 possible.
Uplifting [Point] best 1246 combination 
Uplifting [] best 1246 combination 
Attempting to uplift remaining variables inzp[1]:6 [ main::$10 ]
Uplifting [main] best 1196 combination reg byte y [ main::$10 ] 
Allocated (was zp[2]:7) zp[2]:2 [ main::point_i1#0 ]
Allocated (was zp[2]:9) zp[2]:4 [ main::point_i#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Minimal struct - array of struct - far pointer math indexing
  // Upstart
  // Commodore 64 PRG executable file
.file [name="struct-ptr-2.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const OFFS_Y = 1
.segment Code
  // main
main: {
    .label SCREEN = $400
    .label point_i = 4
    .label point_i1 = 2
    // [1] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [1] phi main::i#2 = 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b1
    // [1] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  __b1_from___b1:
    // [1] phi main::i#2 = main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp __b1
    // main::@1
  __b1:
    // [2] main::$9 = main::i#2 << 1 -- vbuyy=vbuxx_rol_1 
    txa
    asl
    tay
    // [3] main::point_i#0 = points + main::$9 -- pssz1=pssc1_plus_vbuyy 
    tya
    clc
    adc #<points
    sta.z point_i
    lda #>points
    adc #0
    sta.z point_i+1
    // [4] ((char *)points)[main::$9] = main::i#2 -- pbuc1_derefidx_vbuyy=vbuxx 
    txa
    sta points,y
    // [5] main::$3 = main::i#2 + 4 -- vbuaa=vbuxx_plus_vbuc1 
    txa
    clc
    adc #4
    // [6] ((char *)main::point_i#0)[OFFS_Y] = main::$3 -- pbuz1_derefidx_vbuc1=vbuaa 
    // points[i].x = i;
    ldy #OFFS_Y
    sta (point_i),y
    // [7] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [8] if(main::i#1!=4) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #4
    bne __b1_from___b1
    // [9] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    // [9] phi main::i1#2 = 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1 
    ldx #0
    jmp __b2
    // [9] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
  __b2_from___b2:
    // [9] phi main::i1#2 = main::i1#1 [phi:main::@2->main::@2#0] -- register_copy 
    jmp __b2
    // main::@2
  __b2:
    // [10] main::$10 = main::i1#2 << 1 -- vbuyy=vbuxx_rol_1 
    txa
    asl
    tay
    // [11] main::point_i1#0 = points + main::$10 -- pssz1=pssc1_plus_vbuyy 
    tya
    clc
    adc #<points
    sta.z point_i1
    lda #>points
    adc #0
    sta.z point_i1+1
    // [12] main::SCREEN[main::i1#2] = ((char *)points)[main::$10] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda points,y
    sta SCREEN,x
    // [13] (main::SCREEN+$28)[main::i1#2] = ((char *)main::point_i1#0)[OFFS_Y] -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2 
    // SCREEN[i] = points[i].x;
    ldy #OFFS_Y
    lda (point_i1),y
    sta SCREEN+$28,x
    // [14] main::i1#1 = ++ main::i1#2 -- vbuxx=_inc_vbuxx 
    inx
    // [15] if(main::i1#1!=4) goto main::@2 -- vbuxx_neq_vbuc1_then_la1 
    cpx #4
    bne __b2_from___b2
    jmp __breturn
    // main::@return
  __breturn:
    // [16] return 
    rts
}
  // File Data
.segment Data
  points: .fill 2*4, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __b1_from___b1 with __b1
Replacing label __b2_from___b2 with __b2
Removing instruction __b1_from___b1:
Removing instruction __b2_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __b1_from_main:
Removing instruction __b2_from___b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
__constant const char OFFS_Y = 1
void main()
char main::$10 // reg byte y 16.5
char main::$3 // reg byte a 22.0
char main::$9 // reg byte y 16.5
__constant char * const main::SCREEN = (char *) 1024
char main::i
char main::i#1 // reg byte x 16.5
char main::i#2 // reg byte x 9.166666666666666
char main::i1
char main::i1#1 // reg byte x 16.5
char main::i1#2 // reg byte x 11.0
struct Point *main::point_i
struct Point *main::point_i#0 // point_i zp[2]:4 3.6666666666666665
struct Point *main::point_i1
struct Point *main::point_i1#0 // point_i1 zp[2]:2 5.5
__constant struct Point points[4] = { fill( 4, 0) }

reg byte x [ main::i#2 main::i#1 ]
reg byte x [ main::i1#2 main::i1#1 ]
reg byte y [ main::$9 ]
zp[2]:4 [ main::point_i#0 ]
reg byte a [ main::$3 ]
reg byte y [ main::$10 ]
zp[2]:2 [ main::point_i1#0 ]


FINAL ASSEMBLER
Score: 1046

  // File Comments
// Minimal struct - array of struct - far pointer math indexing
  // Upstart
  // Commodore 64 PRG executable file
.file [name="struct-ptr-2.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const OFFS_Y = 1
.segment Code
  // main
main: {
    .label SCREEN = $400
    .label point_i = 4
    .label point_i1 = 2
    // [1] phi from main to main::@1 [phi:main->main::@1]
    // [1] phi main::i#2 = 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [1] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [1] phi main::i#2 = main::i#1 [phi:main::@1->main::@1#0] -- register_copy 
    // main::@1
  __b1:
    // struct Point* point_i = points+i
    // [2] main::$9 = main::i#2 << 1 -- vbuyy=vbuxx_rol_1 
    txa
    asl
    tay
    // [3] main::point_i#0 = points + main::$9 -- pssz1=pssc1_plus_vbuyy 
    tya
    clc
    adc #<points
    sta.z point_i
    lda #>points
    adc #0
    sta.z point_i+1
    // *((byte*)point_i+OFFS_X) = i
    // [4] ((char *)points)[main::$9] = main::i#2 -- pbuc1_derefidx_vbuyy=vbuxx 
    txa
    sta points,y
    // i+4
    // [5] main::$3 = main::i#2 + 4 -- vbuaa=vbuxx_plus_vbuc1 
    txa
    clc
    adc #4
    // *((byte*)point_i+OFFS_Y)  = i+4
    // [6] ((char *)main::point_i#0)[OFFS_Y] = main::$3 -- pbuz1_derefidx_vbuc1=vbuaa 
    // points[i].x = i;
    ldy #OFFS_Y
    sta (point_i),y
    // for( byte i: 0..3)
    // [7] main::i#1 = ++ main::i#2 -- vbuxx=_inc_vbuxx 
    inx
    // [8] if(main::i#1!=4) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #4
    bne __b1
    // [9] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // [9] phi main::i1#2 = 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1 
    ldx #0
    // [9] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
    // [9] phi main::i1#2 = main::i1#1 [phi:main::@2->main::@2#0] -- register_copy 
    // main::@2
  __b2:
    // struct Point* point_i = points+i
    // [10] main::$10 = main::i1#2 << 1 -- vbuyy=vbuxx_rol_1 
    txa
    asl
    tay
    // [11] main::point_i1#0 = points + main::$10 -- pssz1=pssc1_plus_vbuyy 
    tya
    clc
    adc #<points
    sta.z point_i1
    lda #>points
    adc #0
    sta.z point_i1+1
    // SCREEN[i] = *((byte*)point_i+OFFS_X)
    // [12] main::SCREEN[main::i1#2] = ((char *)points)[main::$10] -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy 
    lda points,y
    sta SCREEN,x
    // (SCREEN+40)[i] = *((byte*)point_i+OFFS_Y)
    // [13] (main::SCREEN+$28)[main::i1#2] = ((char *)main::point_i1#0)[OFFS_Y] -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2 
    // SCREEN[i] = points[i].x;
    ldy #OFFS_Y
    lda (point_i1),y
    sta SCREEN+$28,x
    // for( byte i: 0..3)
    // [14] main::i1#1 = ++ main::i1#2 -- vbuxx=_inc_vbuxx 
    inx
    // [15] if(main::i1#1!=4) goto main::@2 -- vbuxx_neq_vbuc1_then_la1 
    cpx #4
    bne __b2
    // main::@return
    // }
    // [16] return 
    rts
}
  // File Data
.segment Data
  points: .fill 2*4, 0

