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
Unwinding value copy (struct Point) main::p ← (struct Point){ (byte) main::x, (number~) main::$0 }
Adding value simple copy (byte) main::p_x ← (byte) main::x
Adding value simple copy (byte) main::p_y ← (number~) main::$0
Replacing struct member reference (struct Point) main::p.x with member unwinding reference (byte) main::p_x
Replacing struct member reference (struct Point) main::p.y with member unwinding reference (byte) main::p_y
Identified constant variable (byte) main::x
Identified constant variable (byte) main::y

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@1

(void()) main()
main: scope:[main]  from @1
  (number~) main::$0 ← (const byte) main::y + (number) 1
  (byte) main::p_x#0 ← (const byte) main::x
  (byte) main::p_y#0 ← (number~) main::$0
  *((const byte*) main::SCREEN + (number) 0) ← (byte) main::p_x#0
  *((const byte*) main::SCREEN + (number) 1) ← (byte) main::p_y#0
  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
(byte) Point::x
(byte) Point::y
(void()) main()
(number~) main::$0
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(byte) main::p_x
(byte) main::p_x#0
(byte) main::p_y
(byte) main::p_y#0
(const byte) main::x = (byte) 2
(const byte) main::y = (byte) 3

Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (const byte) main::y + (number) 1
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (const byte) main::y + (unumber)(number) 1
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (byte) main::p_x#0
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← (byte) main::p_y#0
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (const byte) main::y + (byte) 1
Alias (byte) main::p_y#0 = (byte~) main::$0 
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [0] (byte) main::p_y#0 ← (const byte) main::y + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::p_y#0 = main::y+1
Constant (const byte) main::p_x#0 = main::x
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::SCREEN in [2] *((const byte*) main::SCREEN + (byte) 0) ← (const byte) main::p_x#0
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant inlined main::p_x#0 = (const byte) main::x
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN+1)
Successful SSA optimization Pass2ConstantAdditionElimination
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()

(void()) main()
main: scope:[main]  from @1
  [4] *((const byte*) main::SCREEN) ← (const byte) main::x
  [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0
  to:main::@return
main::@return: scope:[main]  from main
  [6] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte) Point::x
(byte) Point::y
(void()) main()
(byte) main::p_x
(byte) main::p_y

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Minimal struct - initializing using a value list
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @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: {
    .label SCREEN = $400
    .const x = 2
    .const y = 3
    .const p_y = y+1
    // [4] *((const byte*) main::SCREEN) ← (const byte) main::x -- _deref_pbuc1=vbuc2 
    lda #x
    sta SCREEN
    // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 
    lda #p_y
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [6] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) main::SCREEN) ← (const byte) main::x [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 

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

Uplifting [Point] best 33 combination 
Uplifting [main] best 33 combination 
Uplifting [] best 33 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Minimal struct - initializing using a value list
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @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: {
    .label SCREEN = $400
    .const x = 2
    .const y = 3
    .const p_y = y+1
    // [4] *((const byte*) main::SCREEN) ← (const byte) main::x -- _deref_pbuc1=vbuc2 
    lda #x
    sta SCREEN
    // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 
    lda #p_y
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [6] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
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 __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte) Point::x
(byte) Point::y
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::p_x
(byte) main::p_y
(const byte) main::p_y#0 p_y = (const byte) main::y+(byte) 1
(const byte) main::x = (byte) 2
(const byte) main::y = (byte) 3



FINAL ASSEMBLER
Score: 18

  // File Comments
// Minimal struct - initializing using a value list
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  // @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: {
    .label SCREEN = $400
    .const x = 2
    .const y = 3
    .const p_y = y+1
    // SCREEN[0] = p.x
    // [4] *((const byte*) main::SCREEN) ← (const byte) main::x -- _deref_pbuc1=vbuc2 
    lda #x
    sta SCREEN
    // SCREEN[1] = p.y
    // [5] *((const byte*) main::SCREEN+(byte) 1) ← (const byte) main::p_y#0 -- _deref_pbuc1=vbuc2 
    lda #p_y
    sta SCREEN+1
    // main::@return
    // }
    // [6] return 
    rts
}
  // File Data

