Removing C-classic struct-unwound assignment main::point1 = struct-unwound {*(&main::point1)}
Removing C-classic struct-unwound assignment main::point2 = struct-unwound {*(&main::point2)}

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  *(&main::point1) = memcpy(*(&$0), struct Point, SIZEOF_STRUCT_POINT)
  *(&main::point2) = memcpy(*(&$1), struct Point, SIZEOF_STRUCT_POINT)
  print::p_x#0 = *((char *)&main::point1+OFFSET_STRUCT_POINT_X)
  print::p_y#0 = *((char *)&main::point1+OFFSET_STRUCT_POINT_Y)
  call print
  to:main::@1
main::@1: scope:[main]  from main
  print::p_x#1 = *((char *)&main::point2+OFFSET_STRUCT_POINT_X)
  print::p_y#1 = *((char *)&main::point2+OFFSET_STRUCT_POINT_Y)
  call print
  to:main::@2
main::@2: scope:[main]  from main::@1
  to:main::@return
main::@return: scope:[main]  from main::@2
  return 
  to:@return

void print(char p_x , char p_y)
print: scope:[print]  from main main::@1
  print::p_y#2 = phi( main/print::p_y#0, main::@1/print::p_y#1 )
  print::p_x#2 = phi( main/print::p_x#0, main::@1/print::p_x#1 )
  SCREEN[0] = print::p_x#2
  SCREEN[1] = print::p_y#2
  to:print::@return
print::@return: scope:[print]  from print
  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 struct Point $0 = { x: 2, y: 3 }
__constant struct Point $1 = { x: 4, y: 5 }
__constant char OFFSET_STRUCT_POINT_X = 0
__constant char OFFSET_STRUCT_POINT_Y = 1
__constant char * const SCREEN = (char *)$400
__constant char SIZEOF_STRUCT_POINT = 2
void __start()
void main()
__loadstore struct Point main::point1
__loadstore struct Point main::point2
void print(char p_x , char p_y)
struct Point print::p
char print::p_x
char print::p_x#0
char print::p_x#1
char print::p_x#2
char print::p_y
char print::p_y#0
char print::p_y#1
char print::p_y#2

Adding number conversion cast (unumber) 0 in SCREEN[0] = print::p_x#2
Adding number conversion cast (unumber) 1 in SCREEN[1] = print::p_y#2
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying expression containing zero (char *)&main::point1 in [2] print::p_x#0 = *((char *)&main::point1+OFFSET_STRUCT_POINT_X)
Simplifying expression containing zero (char *)&main::point2 in [5] print::p_x#1 = *((char *)&main::point2+OFFSET_STRUCT_POINT_X)
Simplifying expression containing zero SCREEN in [10] SCREEN[0] = print::p_x#2
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant OFFSET_STRUCT_POINT_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
Consolidated array index constant in *(SCREEN+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of main::@2
CALL GRAPH
Calls in [main] to print:6 print:11 

Created 2 initial phi equivalence classes
Coalesced [4] print::p_x#3 = print::p_x#0
Coalesced [5] print::p_y#3 = print::p_y#0
Coalesced [9] print::p_x#4 = print::p_x#1
Coalesced [10] print::p_y#4 = print::p_y#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block label main::@2

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] *(&main::point1) = memcpy(*(&$0), struct Point, SIZEOF_STRUCT_POINT)
  [1] *(&main::point2) = memcpy(*(&$1), struct Point, SIZEOF_STRUCT_POINT)
  [2] print::p_x#0 = *((char *)&main::point1)
  [3] print::p_y#0 = *((char *)&main::point1+OFFSET_STRUCT_POINT_Y)
  [4] call print
  to:main::@1
main::@1: scope:[main]  from main
  [5] print::p_x#1 = *((char *)&main::point2)
  [6] print::p_y#1 = *((char *)&main::point2+OFFSET_STRUCT_POINT_Y)
  [7] call print
  to:main::@return
main::@return: scope:[main]  from main::@1
  [8] return 
  to:@return

void print(char p_x , char p_y)
print: scope:[print]  from main main::@1
  [9] print::p_y#2 = phi( main/print::p_y#0, main::@1/print::p_y#1 )
  [9] print::p_x#2 = phi( main/print::p_x#0, main::@1/print::p_x#1 )
  [10] *SCREEN = print::p_x#2
  [11] *(SCREEN+1) = print::p_y#2
  to:print::@return
print::@return: scope:[print]  from print
  [12] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()
__loadstore struct Point main::point1
__loadstore struct Point main::point2
void print(char p_x , char p_y)
struct Point print::p
char print::p_x
char print::p_x#0 // 2.0
char print::p_x#1 // 2.0
char print::p_x#2 // 15.0
char print::p_y
char print::p_y#0 // 4.0
char print::p_y#1 // 4.0
char print::p_y#2 // 7.5

Initial phi equivalence classes
[ print::p_x#2 print::p_x#0 print::p_x#1 ]
[ print::p_y#2 print::p_y#0 print::p_y#1 ]
Added variable main::point1 to live range equivalence class [ main::point1 ]
Added variable main::point2 to live range equivalence class [ main::point2 ]
Complete equivalence classes
[ print::p_x#2 print::p_x#0 print::p_x#1 ]
[ print::p_y#2 print::p_y#0 print::p_y#1 ]
[ main::point1 ]
[ main::point2 ]
Allocated zp[1]:2 [ print::p_x#2 print::p_x#0 print::p_x#1 ]
Allocated zp[1]:3 [ print::p_y#2 print::p_y#0 print::p_y#1 ]
Allocated zp[2]:4 [ main::point1 ]
Allocated zp[2]:6 [ main::point2 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *(&main::point1) = memcpy(*(&$0), struct Point, SIZEOF_STRUCT_POINT) [ main::point2 main::point1 ] (  [ main::point2 main::point1 ] { { print::p_x#0 = print::p_x#2 } { print::p_y#0 = print::p_y#2 } }  ) always clobbers reg byte a reg byte y 
Statement [1] *(&main::point2) = memcpy(*(&$1), struct Point, SIZEOF_STRUCT_POINT) [ main::point2 main::point1 ] (  [ main::point2 main::point1 ] { { print::p_x#0 = print::p_x#2 } { print::p_y#0 = print::p_y#2 } }  ) always clobbers reg byte a reg byte y 
Potential registers zp[1]:2 [ print::p_x#2 print::p_x#0 print::p_x#1 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:3 [ print::p_y#2 print::p_y#0 print::p_y#1 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:4 [ main::point1 ] : zp[2]:4 , 
Potential registers zp[2]:6 [ main::point2 ] : zp[2]:6 , 

REGISTER UPLIFT SCOPES
Uplift Scope [print] 19: zp[1]:2 [ print::p_x#2 print::p_x#0 print::p_x#1 ] 15.5: zp[1]:3 [ print::p_y#2 print::p_y#0 print::p_y#1 ] 
Uplift Scope [Point] 
Uplift Scope [main] 0: zp[2]:4 [ main::point1 ] 0: zp[2]:6 [ main::point2 ] 
Uplift Scope [] 

Uplifting [print] best 87 combination reg byte x [ print::p_x#2 print::p_x#0 print::p_x#1 ] reg byte a [ print::p_y#2 print::p_y#0 print::p_y#1 ] 
Uplifting [Point] best 87 combination 
Uplifting [main] best 87 combination zp[2]:4 [ main::point1 ] zp[2]:6 [ main::point2 ] 
Uplifting [] best 87 combination 
Allocated (was zp[2]:4) zp[2]:2 [ main::point1 ]
Allocated (was zp[2]:6) zp[2]:4 [ main::point2 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Minimal struct with C-Standard behavior - call parameter (not supported yet)
  // Upstart
  // Commodore 64 PRG executable file
.file [name="struct-22.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 SIZEOF_STRUCT_POINT = 2
  .const OFFSET_STRUCT_POINT_Y = 1
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label point1 = 2
    .label point2 = 4
    // [0] *(&main::point1) = memcpy(*(&$0), struct Point, SIZEOF_STRUCT_POINT) -- _deref_pssc1=_deref_pssc2_memcpy_vbuc3 
    ldy #SIZEOF_STRUCT_POINT
  !:
    lda __0-1,y
    sta point1-1,y
    dey
    bne !-
    // [1] *(&main::point2) = memcpy(*(&$1), struct Point, SIZEOF_STRUCT_POINT) -- _deref_pssc1=_deref_pssc2_memcpy_vbuc3 
    ldy #SIZEOF_STRUCT_POINT
  !:
    lda __1-1,y
    sta point2-1,y
    dey
    bne !-
    // [2] print::p_x#0 = *((char *)&main::point1) -- vbuxx=_deref_pbuc1 
    ldx.z point1
    // [3] print::p_y#0 = *((char *)&main::point1+OFFSET_STRUCT_POINT_Y) -- vbuaa=_deref_pbuc1 
    lda point1+OFFSET_STRUCT_POINT_Y
    // [4] call print
    // [9] phi from main to print [phi:main->print]
  print_from_main:
    // [9] phi print::p_y#2 = print::p_y#0 [phi:main->print#0] -- register_copy 
    // [9] phi print::p_x#2 = print::p_x#0 [phi:main->print#1] -- register_copy 
    jsr print
    jmp __b1
    // main::@1
  __b1:
    // [5] print::p_x#1 = *((char *)&main::point2) -- vbuxx=_deref_pbuc1 
    ldx.z point2
    // [6] print::p_y#1 = *((char *)&main::point2+OFFSET_STRUCT_POINT_Y) -- vbuaa=_deref_pbuc1 
    lda point2+OFFSET_STRUCT_POINT_Y
    // [7] call print
    // [9] phi from main::@1 to print [phi:main::@1->print]
  print_from___b1:
    // [9] phi print::p_y#2 = print::p_y#1 [phi:main::@1->print#0] -- register_copy 
    // [9] phi print::p_x#2 = print::p_x#1 [phi:main::@1->print#1] -- register_copy 
    jsr print
    jmp __breturn
    // main::@return
  __breturn:
    // [8] return 
    rts
}
  // print
// void print(__register(X) char p_x, __register(A) char p_y)
print: {
    // [10] *SCREEN = print::p_x#2 -- _deref_pbuc1=vbuxx 
    stx SCREEN
    // [11] *(SCREEN+1) = print::p_y#2 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    jmp __breturn
    // print::@return
  __breturn:
    // [12] return 
    rts
}
  // File Data
.segment Data
  __0: .byte 2, 3
  __1: .byte 4, 5

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction print_from_main:
Removing instruction __b1:
Removing instruction print_from___b1:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
__constant struct Point $0 = { x: 2, y: 3 }
__constant struct Point $1 = { x: 4, y: 5 }
__constant char OFFSET_STRUCT_POINT_Y = 1
__constant char * const SCREEN = (char *) 1024
__constant char SIZEOF_STRUCT_POINT = 2
void main()
__loadstore struct Point main::point1 // zp[2]:2
__loadstore struct Point main::point2 // zp[2]:4
void print(char p_x , char p_y)
struct Point print::p
char print::p_x
char print::p_x#0 // reg byte x 2.0
char print::p_x#1 // reg byte x 2.0
char print::p_x#2 // reg byte x 15.0
char print::p_y
char print::p_y#0 // reg byte a 4.0
char print::p_y#1 // reg byte a 4.0
char print::p_y#2 // reg byte a 7.5

reg byte x [ print::p_x#2 print::p_x#0 print::p_x#1 ]
reg byte a [ print::p_y#2 print::p_y#0 print::p_y#1 ]
zp[2]:2 [ main::point1 ]
zp[2]:4 [ main::point2 ]


FINAL ASSEMBLER
Score: 78

  // File Comments
// Minimal struct with C-Standard behavior - call parameter (not supported yet)
  // Upstart
  // Commodore 64 PRG executable file
.file [name="struct-22.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 SIZEOF_STRUCT_POINT = 2
  .const OFFSET_STRUCT_POINT_Y = 1
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label point1 = 2
    .label point2 = 4
    // __ma struct Point point1 = { 2, 3 }
    // [0] *(&main::point1) = memcpy(*(&$0), struct Point, SIZEOF_STRUCT_POINT) -- _deref_pssc1=_deref_pssc2_memcpy_vbuc3 
    ldy #SIZEOF_STRUCT_POINT
  !:
    lda __0-1,y
    sta point1-1,y
    dey
    bne !-
    // __ma struct Point point2 = { 4, 5 }
    // [1] *(&main::point2) = memcpy(*(&$1), struct Point, SIZEOF_STRUCT_POINT) -- _deref_pssc1=_deref_pssc2_memcpy_vbuc3 
    ldy #SIZEOF_STRUCT_POINT
  !:
    lda __1-1,y
    sta point2-1,y
    dey
    bne !-
    // print(point1)
    // [2] print::p_x#0 = *((char *)&main::point1) -- vbuxx=_deref_pbuc1 
    ldx.z point1
    // [3] print::p_y#0 = *((char *)&main::point1+OFFSET_STRUCT_POINT_Y) -- vbuaa=_deref_pbuc1 
    lda point1+OFFSET_STRUCT_POINT_Y
    // [4] call print
    // [9] phi from main to print [phi:main->print]
    // [9] phi print::p_y#2 = print::p_y#0 [phi:main->print#0] -- register_copy 
    // [9] phi print::p_x#2 = print::p_x#0 [phi:main->print#1] -- register_copy 
    jsr print
    // main::@1
    // print(point2)
    // [5] print::p_x#1 = *((char *)&main::point2) -- vbuxx=_deref_pbuc1 
    ldx.z point2
    // [6] print::p_y#1 = *((char *)&main::point2+OFFSET_STRUCT_POINT_Y) -- vbuaa=_deref_pbuc1 
    lda point2+OFFSET_STRUCT_POINT_Y
    // [7] call print
    // [9] phi from main::@1 to print [phi:main::@1->print]
    // [9] phi print::p_y#2 = print::p_y#1 [phi:main::@1->print#0] -- register_copy 
    // [9] phi print::p_x#2 = print::p_x#1 [phi:main::@1->print#1] -- register_copy 
    jsr print
    // main::@return
    // }
    // [8] return 
    rts
}
  // print
// void print(__register(X) char p_x, __register(A) char p_y)
print: {
    // SCREEN[0] = p.x
    // [10] *SCREEN = print::p_x#2 -- _deref_pbuc1=vbuxx 
    stx SCREEN
    // SCREEN[1] = p.y
    // [11] *(SCREEN+1) = print::p_y#2 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    // print::@return
    // }
    // [12] return 
    rts
}
  // File Data
.segment Data
  __0: .byte 2, 3
  __1: .byte 4, 5

