Resolved forward reference irq2 to interrupt(KERNEL_MIN)(void()) irq2()
Culled Empty Block (label) @1
Culled Empty Block (label) @2

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

(void()) main()
main: scope:[main]  from @3
  *((const byte*) SCREEN) ← (byte) 'x'
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

interrupt(KERNEL_MIN)(void()) irq1()
irq1: scope:[irq1]  from
  *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq2()
  to:irq1::@return
irq1::@return: scope:[irq1]  from irq1
  return 
  to:@return

interrupt(KERNEL_MIN)(void()) irq2()
irq2: scope:[irq2]  from
  *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq1()
  to:irq2::@return
irq2::@return: scope:[irq2]  from irq2
  return 
  to:@return
@3: scope:[]  from @begin
  call main 
  to:@4
@4: scope:[]  from @3
  to:@end
@end: scope:[]  from @4

SYMBOL TABLE SSA
(label) @3
(label) @4
(label) @begin
(label) @end
(const void()**) HARDWARE_IRQ = (void()**)(number) $fffe
(const byte*) SCREEN = (byte*)(number) $400
interrupt(KERNEL_MIN)(void()) irq1()
(label) irq1::@return
interrupt(KERNEL_MIN)(void()) irq2()
(label) irq2::@return
(void()) main()
(label) main::@return

Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (void()**) 65534
Successful SSA optimization PassNCastSimplification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @4
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) @4
Renumbering block @3 to @1
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*) SCREEN) ← (byte) 'x'
  to:main::@return
main::@return: scope:[main]  from main
  [5] return 
  to:@return

interrupt(KERNEL_MIN)(void()) irq2()
irq2: scope:[irq2]  from
  [6] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq1()
  to:irq2::@return
irq2::@return: scope:[irq2]  from irq2
  [7] return 
  to:@return

interrupt(KERNEL_MIN)(void()) irq1()
irq1: scope:[irq1]  from
  [8] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq2()
  to:irq1::@return
irq1::@return: scope:[irq1]  from irq1
  [9] return 
  to:@return


VARIABLE REGISTER WEIGHTS
interrupt(KERNEL_MIN)(void()) irq1()
interrupt(KERNEL_MIN)(void()) irq2()
(void()) main()

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Unused interrupts pointing to each other but never used from main loop - should be optimized away
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .label HARDWARE_IRQ = $fffe
  // @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: {
    // [4] *((const byte*) SCREEN) ← (byte) 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    sta SCREEN
    jmp __breturn
    // main::@return
  __breturn:
    // [5] return 
    rts
}
  // irq2
// Unused Interrupt Routine
irq2: {
    // entry interrupt(KERNEL_MIN)
    // [6] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq1() -- _deref_pptc1=pprc2 
    lda #<irq1
    sta HARDWARE_IRQ
    lda #>irq1
    sta HARDWARE_IRQ+1
    jmp __breturn
    // irq2::@return
  __breturn:
    // [7] return  - exit interrupt(KERNEL_MIN)
    jmp $ea81
}
  // irq1
// Unused Interrupt Routine
irq1: {
    // entry interrupt(KERNEL_MIN)
    // [8] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq2() -- _deref_pptc1=pprc2 
    lda #<irq2
    sta HARDWARE_IRQ
    lda #>irq2
    sta HARDWARE_IRQ+1
    jmp __breturn
    // irq1::@return
  __breturn:
    // [9] return  - exit interrupt(KERNEL_MIN)
    jmp $ea81
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) SCREEN) ← (byte) 'x' [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq1() [ ] (  [ ] ) always clobbers reg byte a 
Statement [8] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq2() [ ] (  [ ] ) always clobbers reg byte a 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 
Uplift Scope [irq1] 
Uplift Scope [irq2] 
Uplift Scope [] 

Uplifting [main] best 63 combination 
Uplifting [irq1] best 63 combination 
Uplifting [irq2] best 63 combination 
Uplifting [] best 63 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Unused interrupts pointing to each other but never used from main loop - should be optimized away
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .label HARDWARE_IRQ = $fffe
  // @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: {
    // [4] *((const byte*) SCREEN) ← (byte) 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    sta SCREEN
    jmp __breturn
    // main::@return
  __breturn:
    // [5] return 
    rts
}
  // irq2
// Unused Interrupt Routine
irq2: {
    // entry interrupt(KERNEL_MIN)
    // [6] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq1() -- _deref_pptc1=pprc2 
    lda #<irq1
    sta HARDWARE_IRQ
    lda #>irq1
    sta HARDWARE_IRQ+1
    jmp __breturn
    // irq2::@return
  __breturn:
    // [7] return  - exit interrupt(KERNEL_MIN)
    jmp $ea81
}
  // irq1
// Unused Interrupt Routine
irq1: {
    // entry interrupt(KERNEL_MIN)
    // [8] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq2() -- _deref_pptc1=pprc2 
    lda #<irq2
    sta HARDWARE_IRQ
    lda #>irq2
    sta HARDWARE_IRQ+1
    jmp __breturn
    // irq1::@return
  __breturn:
    // [9] return  - exit interrupt(KERNEL_MIN)
    jmp $ea81
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __breturn
Removing instruction jmp __breturn
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:
Removing instruction __breturn:
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 void()**) HARDWARE_IRQ = (void()**) 65534
(const byte*) SCREEN = (byte*) 1024
interrupt(KERNEL_MIN)(void()) irq1()
(label) irq1::@return
interrupt(KERNEL_MIN)(void()) irq2()
(label) irq2::@return
(void()) main()
(label) main::@return



FINAL ASSEMBLER
Score: 42

  // File Comments
// Unused interrupts pointing to each other but never used from main loop - should be optimized away
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .label HARDWARE_IRQ = $fffe
  // @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: {
    // *SCREEN = 'x'
    // [4] *((const byte*) SCREEN) ← (byte) 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    sta SCREEN
    // main::@return
    // }
    // [5] return 
    rts
}
  // irq2
// Unused Interrupt Routine
irq2: {
    // entry interrupt(KERNEL_MIN)
    // *HARDWARE_IRQ = &irq1
    // [6] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq1() -- _deref_pptc1=pprc2 
    lda #<irq1
    sta HARDWARE_IRQ
    lda #>irq1
    sta HARDWARE_IRQ+1
    // irq2::@return
    // }
    // [7] return  - exit interrupt(KERNEL_MIN)
    jmp $ea81
}
  // irq1
// Unused Interrupt Routine
irq1: {
    // entry interrupt(KERNEL_MIN)
    // *HARDWARE_IRQ = &irq2
    // [8] *((const void()**) HARDWARE_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq2() -- _deref_pptc1=pprc2 
    lda #<irq2
    sta HARDWARE_IRQ
    lda #>irq2
    sta HARDWARE_IRQ+1
    // irq1::@return
    // }
    // [9] return  - exit interrupt(KERNEL_MIN)
    jmp $ea81
}
  // File Data

