Fixing struct type size struct Person to 16
Fixing struct type size struct Person to 16
Fixing struct type SIZE_OF struct Person to 16
Fixing struct type SIZE_OF struct Person to 16
Fixing pointer increment (struct Person*) main::person ← ++ (struct Person*) main::person
Fixing pointer array-indexing *((const struct Person*) persons + (number) 0)
Fixing pointer array-indexing *((const struct Person*) persons + (number) 1)
Fixing pointer array-indexing *((const struct Person*) persons + (number) 0)
Fixing pointer array-indexing *((const struct Person*) persons + (number) 1)
Fixing pointer array-indexing *((const struct Person*) persons + (number) 0)
Fixing pointer array-indexing *((const struct Person*) persons + (number) 1)
Replacing struct member reference *((const struct Person*) persons + (number~) main::$0).id with member unwinding reference *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (number~) main::$0)
Replacing struct member reference *((const struct Person*) persons + (number~) main::$1).id with member unwinding reference *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (number~) main::$1)
Replacing struct member reference *((const struct Person*) persons + (number~) main::$2).name with member unwinding reference (byte*~) main::$6
Replacing struct member reference *((const struct Person*) persons + (number~) main::$3).name with member unwinding reference (byte*~) main::$7
Replacing struct member reference *((const struct Person*) persons + (number~) main::$4).age with member unwinding reference *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (number~) main::$4)
Replacing struct member reference *((const struct Person*) persons + (number~) main::$5).age with member unwinding reference *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (number~) main::$5)
Replacing struct member reference *((struct Person*) main::person).name with member unwinding reference (byte*~) main::$8
Replacing struct member reference *((struct Person*) main::person).name with member unwinding reference (byte*~) main::$9

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

(void()) main()
main: scope:[main]  from @1
  (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
  *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (number~) main::$0) ← (number) 7
  (number~) main::$1 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
  *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (number~) main::$1) ← (number) 9
  (number~) main::$2 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
  (byte*~) main::$6 ← (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME + (number~) main::$2
  *((byte*~) main::$6 + (number) 8) ← (byte) 'a'
  (number~) main::$3 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
  (byte*~) main::$7 ← (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME + (number~) main::$3
  *((byte*~) main::$7 + (number) 8) ← (byte) 'b'
  (number~) main::$4 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
  *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (number~) main::$4) ← (number) $141
  (number~) main::$5 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
  *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (number~) main::$5) ← (number) $7b
  (struct Person*) main::person#0 ← (const struct Person*) persons
  (byte*~) main::$8 ← (byte*)(struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
  *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$8 + (number) 8)
  (struct Person*) main::person#1 ← (struct Person*) main::person#0 + (const byte) SIZEOF_STRUCT_PERSON
  (byte*~) main::$9 ← (byte*)(struct Person*) main::person#1 + (const byte) OFFSET_STRUCT_PERSON_NAME
  *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$9 + (number) 8)
  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
(const byte) OFFSET_STRUCT_PERSON_AGE = (byte) $e
(const byte) OFFSET_STRUCT_PERSON_ID = (byte) 0
(const byte) OFFSET_STRUCT_PERSON_NAME = (byte) 1
(word) Person::age
(byte) Person::id
(const byte*) Person::name[(number) $d]  = { fill( $d, 0) }
(const byte) SIZEOF_STRUCT_PERSON = (byte) $10
(void()) main()
(number~) main::$0
(number~) main::$1
(number~) main::$2
(number~) main::$3
(number~) main::$4
(number~) main::$5
(byte*~) main::$6
(byte*~) main::$7
(byte*~) main::$8
(byte*~) main::$9
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(struct Person*) main::person
(struct Person*) main::person#0
(struct Person*) main::person#1
(const struct Person*) persons[(number) 2]  = { fill( 2, 0) }

Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) 7 in *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (unumber~) main::$0) ← (number) 7
Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) 9 in *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (unumber~) main::$1) ← (number) 9
Adding number conversion cast (unumber) 0 in (number~) main::$2 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) 8 in *((byte*~) main::$6 + (number) 8) ← (byte) 'a'
Adding number conversion cast (unumber) 1 in (number~) main::$3 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) 8 in *((byte*~) main::$7 + (number) 8) ← (byte) 'b'
Adding number conversion cast (unumber) 0 in (number~) main::$4 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) $141 in *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (unumber~) main::$4) ← (number) $141
Adding number conversion cast (unumber) 1 in (number~) main::$5 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_PERSON
Adding number conversion cast (unumber) $7b in *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (unumber~) main::$5) ← (number) $7b
Adding number conversion cast (unumber) 8 in *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$8 + (number) 8)
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$8 + (unumber)(number) 8)
Adding number conversion cast (unumber) 8 in *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$9 + (number) 8)
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$9 + (unumber)(number) 8)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (unumber~) main::$0) ← (unumber)(number) 7
Inlining cast *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (unumber~) main::$1) ← (unumber)(number) 9
Inlining cast *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (unumber~) main::$4) ← (unumber)(number) $141
Inlining cast *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (unumber~) main::$5) ← (unumber)(number) $7b
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 7
Simplifying constant integer cast 1
Simplifying constant integer cast 9
Simplifying constant integer cast 0
Simplifying constant integer cast 8
Simplifying constant integer cast 1
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Simplifying constant integer cast $141
Simplifying constant integer cast 1
Simplifying constant integer cast $7b
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Simplifying constant integer cast 8
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 9
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $141
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $7b
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
Inferred type updated to byte in (unumber~) main::$1 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
Inferred type updated to byte in (unumber~) main::$2 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
Inferred type updated to byte in (unumber~) main::$3 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
Inferred type updated to byte in (unumber~) main::$4 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
Inferred type updated to byte in (unumber~) main::$5 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
Constant right-side identified [0] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
Constant right-side identified [2] (byte~) main::$1 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
Constant right-side identified [4] (byte~) main::$2 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
Constant right-side identified [7] (byte~) main::$3 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
Constant right-side identified [10] (byte~) main::$4 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
Constant right-side identified [12] (byte~) main::$5 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = 0*SIZEOF_STRUCT_PERSON
Constant (const byte) main::$1 = 1*SIZEOF_STRUCT_PERSON
Constant (const byte) main::$2 = 0*SIZEOF_STRUCT_PERSON
Constant (const byte) main::$3 = 1*SIZEOF_STRUCT_PERSON
Constant (const byte) main::$4 = 0*SIZEOF_STRUCT_PERSON
Constant (const byte) main::$5 = 1*SIZEOF_STRUCT_PERSON
Constant (const struct Person*) main::person#0 = persons
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (byte*)main::person#0 in [15] (byte*~) main::$8 ← (byte*)(const struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
Successful SSA optimization Pass2ConstantValues
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_PERSON in 
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_PERSON in 
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_PERSON in 
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero (byte*)persons+OFFSET_STRUCT_PERSON_ID in [1] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (const byte) main::$0) ← (byte) 7
Simplifying expression containing zero (byte*)persons in [1] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID) ← (byte) 7
Simplifying expression containing zero (byte*)persons in [3] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_ID + (const byte) main::$1) ← (byte) 9
Simplifying expression containing zero (byte*)persons+OFFSET_STRUCT_PERSON_NAME in [5] (byte*~) main::$6 ← (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME + (const byte) main::$2
Simplifying expression containing zero (word*)persons+OFFSET_STRUCT_PERSON_AGE in [11] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE + (const byte) main::$4) ← (word) $141
Simplifying expression containing zero main::SCREEN in [16] *((const byte*) main::SCREEN + (byte) 0) ← *((byte*~) main::$8 + (byte) 8)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::$0
Eliminating unused constant (const byte) main::$2
Eliminating unused constant (const byte) main::$4
Eliminating unused constant (const byte) OFFSET_STRUCT_PERSON_ID
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [4] (byte*~) main::$7 ← (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME + (const byte) main::$3
Constant right-side identified [8] (byte*~) main::$8 ← (byte*)(const struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
Constant right-side identified [10] (struct Person*) main::person#1 ← (const struct Person*) main::person#0 + (const byte) SIZEOF_STRUCT_PERSON
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::$6 = (byte*)persons+OFFSET_STRUCT_PERSON_NAME
Constant (const byte*) main::$7 = (byte*)persons+OFFSET_STRUCT_PERSON_NAME+main::$3
Constant (const byte*) main::$8 = (byte*)main::person#0+OFFSET_STRUCT_PERSON_NAME
Constant (const struct Person*) main::person#1 = main::person#0+SIZEOF_STRUCT_PERSON
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (byte*)main::person#1 in [11] (byte*~) main::$9 ← (byte*)(const struct Person*) main::person#1 + (const byte) OFFSET_STRUCT_PERSON_NAME
Successful SSA optimization Pass2ConstantValues
Constant right-side identified [7] (byte*~) main::$9 ← (byte*)(const struct Person*) main::person#1 + (const byte) OFFSET_STRUCT_PERSON_NAME
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::$9 = (byte*)main::person#1+OFFSET_STRUCT_PERSON_NAME
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const struct Person*) main::person#0
Constant inlined main::$1 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
Constant inlined main::$5 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
Constant inlined main::$6 = (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME
Constant inlined main::$3 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
Constant inlined main::$9 = (byte*)(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME
Constant inlined main::$7 = (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON
Constant inlined main::person#0 = (const struct Person*) persons
Constant inlined main::$8 = (byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *((byte*)persons+1*SIZEOF_STRUCT_PERSON)
Consolidated array index constant in *((byte*)persons+OFFSET_STRUCT_PERSON_NAME+8)
Consolidated array index constant in *((byte*)persons+OFFSET_STRUCT_PERSON_NAME+1*SIZEOF_STRUCT_PERSON+8)
Consolidated array index constant in *((word*)persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON)
Consolidated array index constant in *((byte*)persons+OFFSET_STRUCT_PERSON_NAME+8)
Consolidated array index constant in *((byte*)main::person#1+OFFSET_STRUCT_PERSON_NAME+8)
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] *((byte*)(const struct Person*) persons) ← (byte) 7
  [5] *((byte*)(const struct Person*) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9
  [6] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a'
  [7] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(byte) 8) ← (byte) 'b'
  [8] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141
  [9] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b
  [10] *((const byte*) main::SCREEN) ← *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
  [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
  to:main::@return
main::@return: scope:[main]  from main
  [12] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(word) Person::age
(byte) Person::id
(void()) main()
(struct Person*) main::person

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Example of a struct containing an array
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_STRUCT_PERSON = $10
  .const OFFSET_STRUCT_PERSON_NAME = 1
  .const OFFSET_STRUCT_PERSON_AGE = $e
  // @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
    .label person = persons+SIZEOF_STRUCT_PERSON
    // [4] *((byte*)(const struct Person*) persons) ← (byte) 7 -- _deref_pbuc1=vbuc2 
    lda #7
    sta persons
    // [5] *((byte*)(const struct Person*) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2 
    lda #9
    sta persons+1*SIZEOF_STRUCT_PERSON
    // [6] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2 
    lda #'a'
    sta persons+OFFSET_STRUCT_PERSON_NAME+8
    // [7] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2 
    lda #'b'
    sta persons+OFFSET_STRUCT_PERSON_NAME+1*SIZEOF_STRUCT_PERSON+8
    // [8] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2 
    lda #<$141
    sta persons+OFFSET_STRUCT_PERSON_AGE
    lda #>$141
    sta persons+OFFSET_STRUCT_PERSON_AGE+1
    // [9] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2 
    lda #0
    sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON+1
    lda #<$7b
    sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON
    // [10] *((const byte*) main::SCREEN) ← *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2 
    lda persons+OFFSET_STRUCT_PERSON_NAME+8
    sta SCREEN
    // [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2 
    lda person+OFFSET_STRUCT_PERSON_NAME+8
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [12] return 
    rts
}
  // File Data
  persons: .fill $10*2, 0

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((byte*)(const struct Person*) persons) ← (byte) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] *((byte*)(const struct Person*) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(byte) 8) ← (byte) 'b' [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [8] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [9] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [10] *((const byte*) main::SCREEN) ← *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) [ ] ( main:2 [ ] ) always clobbers reg byte a 

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

Uplifting [Person] best 85 combination 
Uplifting [main] best 85 combination 
Uplifting [] best 85 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Example of a struct containing an array
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_STRUCT_PERSON = $10
  .const OFFSET_STRUCT_PERSON_NAME = 1
  .const OFFSET_STRUCT_PERSON_AGE = $e
  // @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
    .label person = persons+SIZEOF_STRUCT_PERSON
    // [4] *((byte*)(const struct Person*) persons) ← (byte) 7 -- _deref_pbuc1=vbuc2 
    lda #7
    sta persons
    // [5] *((byte*)(const struct Person*) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2 
    lda #9
    sta persons+1*SIZEOF_STRUCT_PERSON
    // [6] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2 
    lda #'a'
    sta persons+OFFSET_STRUCT_PERSON_NAME+8
    // [7] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2 
    lda #'b'
    sta persons+OFFSET_STRUCT_PERSON_NAME+1*SIZEOF_STRUCT_PERSON+8
    // [8] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2 
    lda #<$141
    sta persons+OFFSET_STRUCT_PERSON_AGE
    lda #>$141
    sta persons+OFFSET_STRUCT_PERSON_AGE+1
    // [9] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2 
    lda #0
    sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON+1
    lda #<$7b
    sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON
    // [10] *((const byte*) main::SCREEN) ← *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2 
    lda persons+OFFSET_STRUCT_PERSON_NAME+8
    sta SCREEN
    // [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2 
    lda person+OFFSET_STRUCT_PERSON_NAME+8
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [12] return 
    rts
}
  // File Data
  persons: .fill $10*2, 0

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
(const byte) OFFSET_STRUCT_PERSON_AGE = (byte) $e
(const byte) OFFSET_STRUCT_PERSON_NAME = (byte) 1
(word) Person::age
(byte) Person::id
(const byte*) Person::name[(number) $d]  = { fill( $d, 0) }
(const byte) SIZEOF_STRUCT_PERSON = (byte) $10
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Person*) main::person
(const struct Person*) main::person#1 person = (const struct Person*) persons+(const byte) SIZEOF_STRUCT_PERSON
(const struct Person*) persons[(number) 2]  = { fill( 2, 0) }



FINAL ASSEMBLER
Score: 70

  // File Comments
// Example of a struct containing an array
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_STRUCT_PERSON = $10
  .const OFFSET_STRUCT_PERSON_NAME = 1
  .const OFFSET_STRUCT_PERSON_AGE = $e
  // @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
    .label person = persons+SIZEOF_STRUCT_PERSON
    // persons[0].id = 7
    // [4] *((byte*)(const struct Person*) persons) ← (byte) 7 -- _deref_pbuc1=vbuc2 
    lda #7
    sta persons
    // persons[1].id = 9
    // [5] *((byte*)(const struct Person*) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2 
    lda #9
    sta persons+1*SIZEOF_STRUCT_PERSON
    // persons[0].name[8] = 'a'
    // [6] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2 
    lda #'a'
    sta persons+OFFSET_STRUCT_PERSON_NAME+8
    // persons[1].name[8] = 'b'
    // [7] *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2 
    lda #'b'
    sta persons+OFFSET_STRUCT_PERSON_NAME+1*SIZEOF_STRUCT_PERSON+8
    // persons[0].age = 321
    // [8] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2 
    lda #<$141
    sta persons+OFFSET_STRUCT_PERSON_AGE
    lda #>$141
    sta persons+OFFSET_STRUCT_PERSON_AGE+1
    // persons[1].age = 123
    // [9] *((word*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2 
    lda #0
    sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON+1
    lda #<$7b
    sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON
    // SCREEN[0] = person->name[8]
    // [10] *((const byte*) main::SCREEN) ← *((byte*)(const struct Person*) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2 
    lda persons+OFFSET_STRUCT_PERSON_NAME+8
    sta SCREEN
    // SCREEN[1] = person->name[8]
    // [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2 
    lda person+OFFSET_STRUCT_PERSON_NAME+8
    sta SCREEN+1
    // main::@return
    // }
    // [12] return 
    rts
}
  // File Data
  persons: .fill $10*2, 0

