// ============================================
// output - Part 1 of 2
// ============================================
// KickAssembler syntax
// Generated by Restore 64 v0.2.1 alpha build 298, 2026-04-11 21:35:56
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0800  End: $da03  (53764 bytes)
// Note: PRG was crunched, depacked by emulation
// Packer entry: $080b (via BASIC SYS 2059)
// Entry point:  $0813 (2067)
// IRQ handler:  $0813 (main_0813)
// IRQ handler:  $ea31 (irq_ea31)
// IRQ handler:  $09c2 (irq_09c2)
//
// Code: 531 bytes, Data: 53233 bytes
// Labels: 73, Subroutines: 8
//
// Verification: 5 line(s) auto-corrected to .byte for exact byte matching
//
// Cross-references: all OK
// ============================================


// --- Region $0812-$0951 ---
.pc = $0812 "loc_0812"

loc_0812:
        brk

main_0813:
        sei
        lda #$13
        sta $0318
        lda #$08
        sta $0319
        cli
        lda #$06
        sta $d020
        sta $d021
        lda #$73
        ldy #$0b
        jsr sub_ab1e
        lda #$96
        sta $58
        sta $57
        ldx #$11
        ldy #$00
        jsr $e50c
        lda #$7b
        ldy #$0d
        jsr sub_ab1e
        jsr sub_0987
        jsr sub_0992
        jsr sub_0bb3
        jsr sub_0b94
        lda #$81
        sta $af

loc_0852:
        dec $57
        inc $58
        jsr sub_0b83
        jsr $ffe4
        cmp #$5f
        bne loc_0863
        jmp loc_08e3

loc_0863:
        lda $57
        cmp #$32
        bne loc_0852
        jsr sub_0987
        lda #$07
        sta $ae
        jsr sub_0d6c
        jsr sub_0987
        lda #$41
        sta $af
        lda #$53
        sta $8b
        lda #$0a
        sta $8c
        jsr sub_0987
        lda #$00
        sta $8d
        sta $0286
        sei
        lda #$b1
        sta $0314
        cli

loc_0893:
        ldx #$16
        ldy #$00
        jsr $e50c
        lda $8b
        ldy $8c
        jsr sub_ab1e
        lda $0286
        cmp #$01
        bne loc_08ab
        jsr sub_0b83

loc_08ab:
        lda #$16
        jsr sub_0985
        ldx $8d
        lda $0b78,x
        cmp #$ff
        beq loc_08c1
        sta $0286
        inc $8d
        jmp loc_0893

loc_08c1:
        lda #$00
        sta $8d
        clc
        lda $8b
        adc #$29
        sta $8b
        lda $8c
        adc #$00
        sta $8c
        ldx #$00
        lda ($8b,x)
        cmp #$ff
        beq loc_08e0
        jsr sub_0987
        jmp loc_0893

loc_08e0:
        jsr sub_0987

loc_08e3:
        ldx #$16
        jsr $e9ff
        jsr sub_0bb3
        lda #$06
        sta $ae
        jsr sub_0d6c
        lda #$81
        sta $af

loc_08f6:
        inc $57
        dec $58
        jsr sub_0b83
        lda $57
        cmp #$96
        bne loc_08f6
        jsr sub_0987
        lda #$13
        jsr $ffd2
        lda #$11
        ldx #$32

loc_090f:
        jsr $ffd2
        dex
        bpl loc_090f
        jsr sub_0987
        lda #$00
        sta $c6
        sta $d418
        sei
        jsr $e5a0
        jsr $e51b
        jsr $ff5e
        sei
        lda #$31
        sta $0314
        lda #$ea
        sta $0315
        cli
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        jsr sub_0d6c
        jmp $fce2

dat_0950:
        .byte $5d,$09                               // ].

// --- Region $095d-$09b0 ---
.pc = $095d "loc_095d"

loc_095d:
        lda #$00
        sta $8b
        lda #$0e
        sta $8c
        lda #$01
        sta $8d
        lda #$08
        sta $8e

loc_096d:
        ldy #$00

loc_096f:
        lda ($8b),y
        sta ($8d),y
        iny
        bne loc_096f
        inc $8c
        inc $8e
        lda $8c
        cmp $2e
        bcc loc_096d
        beq loc_096d
        jmp loc_0812
// Referenced by: jsr from $08ad, $0b8a

sub_0985:
        sta $8e

// Referenced by: jsr from $0842, $0869, $0873, $0882, $08da, $08e0, $0903, $0915
sub_0987: {
        dec $8e
loop:
        inc $8f
        bne loop
        lda $8e
        bne sub_0987
        rts
}
// Referenced by: jsr from $0845

sub_0992:
        sei
        lda #$c2
        sta $0314
        lda #$09
        sta $0315
        lda $57
        sta $d012
        lda $d011
        and #$7f
        sta $d011
        lda #$81
        sta $d01a
        cli
        rts

// --- Region $09c2-$09f6 ---
.pc = $09c2 "irq_09c2"

irq_09c2:
        lda $d019
        sta $d019
        bmi loc_09d1
        lda $dc0d
        cli
        jmp $ea31

loc_09d1:
        lda $d012
        cmp $58
        bcs loc_09e5
        lda #$00
        sta $d020
        sta $d021
        lda $58
        jmp loc_09ef

loc_09e5:
        lda #$06
        sta $d020
        sta $d021
        lda $57

loc_09ef:
        sta $d012
        jmp $febc

dat_09f5:
        .byte $13,$1f                               // ..

// --- Region $0b83-$0bc1 ---
.pc = $0b83 "sub_0b83"
// Referenced by: jsr from $0856, $08a8, $08fa

sub_0b83:
        lda $af
        sta $d40b
        lda #$14
        jsr sub_0985
        ldx $af
        dex
        stx $d40b
        rts
// Referenced by: jsr from $084b

sub_0b94:
        lda #$0f
        sta $d418
        lda #$cf
        sta $d407
        lda #$32
        sta $d408
        lda #$ff
        sta $d409
        lda #$02
        sta $d40a
        lda #$ac
        sta $d40d
        rts
// Referenced by: jsr from $0848, $08e8

sub_0bb3:
        sei
        lda #$c2
        sta $0314
        cli
        lda #$f5
        ldy #$09
.label spr_0bc0 = * + 2
        jsr sub_ab1e

dat_0bc1:
        .byte $a9

// --- Region $0d6c-$0d7a ---
.pc = $0d6c "sub_0d6c"
// Referenced by: jsr from $0870, $08ef, $094a

sub_0d6c:
        ldx #$62

loc_0d6e:
        lda $0d08,x
        tay
        lda $ae
        sta $d93f,y
        dex
        bpl loc_0d6e
        rts

// --- Region $8dd0-$8dd0 ---
.pc = $8dd0 "Segment $8dd0"
        brk

// --- Region $ab1e-$ab1e ---
.pc = $ab1e "sub_ab1e"
// Referenced by: jsr from $082b, $083f, $089e, $0bbe

sub_ab1e:
        brk

// ============================================
// Data blocks
// ============================================

// --- Region $0801-$0811 ---
.pc = $0801 "dat_0801"

dat_0801:
        // === BASIC loader stub ===
        .byte $11,$08                                                     // [corrected] was: .byte $0b,$08                               // next line pointer ($080b)
        .byte $c1,$07                                                     // [corrected] was: .byte $00,$00                               // line number 0
        .byte $9e                                   // SYS token
        .byte $20,$32,$30,$36
        .byte $37                                                         // [corrected] was: .byte $00                                   // end of line
        .byte $20,$28                                                     // [corrected] was: .byte $00,$00                               // end of BASIC program
        .byte $54,$4d,$29,$00,$00                   // TM)..

// --- Region $0952-$095c ---
.pc = $0952 "Program $0952"
        .byte $9d,$3e,$03,$e8,$e0,$32,$d0,$f5,$4c,$3e,$03 // .>...2..L>.

// --- Region $09b1-$09c1 ---
.pc = $09b1 "dat_09b1"

dat_09b1:
        .byte $ae,$12,$d0,$e0,$62,$b0,$0a,$bd,$08,$0d,$aa,$ad,$12,$d0,$9d,$3f // ....b..........?
        .byte $d9                                   // .

// --- Region $09f7-$0b82 ---
.pc = $09f7 "Program $09f7"
        .byte $11,$11,$11                           // ...

txt_09fa:
        .text "               "
        .byte $b9                                   // '9' | $80 (end-of-string marker)
        .byte $b9,$b9,$20,$bb,$20,$bb,$20,$ac,$a2,$a2,$0d // .. . . ....

txt_0a15:
        .text "                "
        .byte $a1                                   // '!' | $80 (end-of-string marker)
        .byte $20,$20,$12,$bc,$92,$a2,$a1,$20,$12,$a1,$92,$a2,$0d //   ..... .....

txt_0a33:
        .text "               "
        .byte $ac                                   // ',' | $80 (end-of-string marker)
        .byte $a1                                   // .

txt_0a44:
        .text "  "
        .byte $a1                                   // '!' | $80 (end-of-string marker)
        .byte $20,$a1,$20,$12,$a1,$92,$a2,$a2,$11,$11,$0d,$00 //  . .........

txt_0a53:
        .text "                PRESENTS                "
        .byte $00                                   // string terminator

txt_0a7c:
        .text "               A.L.M.A.Z.Z              "
        .byte $00                                   // string terminator

txt_0aa5:
        .text "       CRACKED BY KATER KARLO 1985      "
        .byte $00                                   // string terminator

txt_0ace:
        .text "             DISPATCHED  BY             "
        .byte $00                                   // string terminator

txt_0af7:
        .text "              THE MEDIATOR              "
        .byte $00                                   // string terminator

txt_0b20:
        .text "          SPECIAL GREETINGS TO          "
        .byte $00                                   // string terminator

txt_0b49:
        .text "               SECTION  8               "
        .byte $00                                   // string terminator
        .byte $ff,$93,$8e,$08,$92,$00,$00,$0b,$0c,$0f,$01,$01,$0f,$0c,$0b,$00 // ................
        .byte $ff                                   // .

// --- Region $0bc2-$0d6b ---
.pc = $0bc2 "Program $0bc2"
        .byte $cf
        .byte $a0,$0b,$20                           // #.#.........#.##..#.....
        .byte $1e,$ab,$a9                           // ...####.#.#.#.###.#.#..#
        .byte $94,$a0,$0c                           // #..#.#..#.#.........##..
        .byte $4c,$1e,$ab                           // .#..##.....####.#.#.#.##
        .byte $12,$a9

txt_0bd1:
        .byte $20
        .byte $20,$20,$20                           // ..#.......#.......#.....
        .byte $df,$a9,$20                           // ##.######.#.#..#..#.....
        .byte $20,$20,$df                           // ..#.......#.....##.#####
        .byte $a9,$20,$20                           // #.#.#..#..#.......#.....
        .byte $20,$df,$a9                           // ..#.....##.######.#.#..#
        .byte $df,$a9,$20                           // ##.######.#.#..#..#.....
        .byte $20,$20,$df                           // ..#.......#.....##.#####
        .byte $a9

txt_0be8:
        .byte $20,$20
        .byte $20,$20,$df                           // ..#.......#.....##.#####
        .byte $a9,$20,$20                           // #.#.#..#..#.......#.....
        .byte $20,$df,$a9                           // ..#.....##.######.#.#..#
        .byte $20,$20,$20                           // ..#.......#.......#.....
        .byte $df,$92,$20                           // ##.######..#..#...#.....
        .byte $12

txt_0bfa:
        .byte $20,$20
        .byte $20,$20,$20                           // ..#.......#.......#.....
        .byte $20                                   // sprite 0 padding
        .byte $20,$20,$20                           // ..#.......#.......#.....
        .byte $20,$92,$a9                           // ..#.....#..#..#.#.#.#..#
        .byte $12

txt_0c07:
        .text "                 "
        .byte $92,$a9,$12                           // ...

txt_0c1b:
        .text "          "
        .byte $92,$20,$12,$20,$20,$20,$92,$a9,$12   // . .   ...

txt_0c2e:
        .text "      "
        .byte $92,$20,$12,$20,$20,$92,$20,$12       // . .  . .

txt_0c3c:
        .text "         "
        .byte $92,$20,$20,$12,$20,$20,$92,$20,$20,$12,$20,$20,$92,$20,$12 // .  .  .  .  . .

txt_0c54:
        .text "      "
        .byte $92,$a9,$20,$12,$20,$20,$92,$20,$20,$12 // .. .  .  .

txt_0c64:
        .text "     "
        .byte $92,$a9,$20,$12,$20,$20,$92,$20,$12   // .. .  . .

txt_0c72:
        .text "         "
        .byte $92,$20,$20,$12,$20,$20,$92,$20,$20,$12,$20,$20,$92,$20,$12 // .  .  .  .  . .

txt_0c8a:
        .text "      "
        .byte $92,$a1,$20,$00,$12,$20,$20,$92,$20,$20,$12 // .. ..  .  .

txt_0c9b:
        .text "           "
        .byte $92,$a9,$12                           // ...

txt_0ca9:
        .text "    "
        .byte $92,$20,$12,$20,$20,$92,$20,$20,$12,$20,$20,$92,$20,$20,$12 // . .  .  .  .  .

txt_0cbc:
        .text "       "
        .byte $92,$20,$12,$20,$20,$92,$20,$12,$20,$92,$a9,$20,$20,$12,$20,$92 // . .  . . ..  . .
        .byte $a9,$12                               // ..

txt_0cd5:
        .text "    "
        .byte $92,$a9,$12,$20,$20,$20,$92,$a9,$20,$12,$20,$92,$a9,$12,$20,$92 // ...   .. . ... .
        .byte $a9,$20,$12,$20,$92,$a9,$20,$20,$12,$20,$92,$a9,$20,$20,$12 // . . ..  . ..  .

txt_0cf8:
        .text "    "
        .byte $92,$a9,$12,$20,$92,$a9,$20,$12,$20,$92,$a9,$00,$60,$3a,$b4,$8a // ... .. . ...`:..
        .byte $b2,$a9,$7e,$64,$09,$1c,$0b,$3c,$58,$76,$5a,$74,$8f,$21,$0f,$1a // ..~d...<XvZt.!..
        .byte $4a,$6f,$02,$9f,$04,$38,$06,$6b,$2c,$5d,$52,$14,$c7,$4c,$17,$30 // Jo...8.k,]R..L.0
        .byte $3f,$08,$65,$19,$47,$1b,$0a,$1d,$43,$2a,$93,$0d,$72,$22,$10,$35 // ?.e.G...C*..r".5
        .byte $05,$2e,$12,$af,$25,$59,$27,$16,$4f,$1f,$75,$ab,$c2,$a6,$b7,$b0 // ....%Y'.O.u.....
        .byte $15,$aa,$c1,$c0,$a2,$62,$9c,$56,$ae,$20,$78,$24,$03,$ad,$8c,$bf // .....b.V. x$....
        .byte $77,$26,$88,$85,$bb,$67,$7a,$a8,$80,$97,$9a,$66,$56,$0e,$c4,$ff // w&...gz....fV...

// --- Region $0d7b-$0e01 ---
.pc = $0d7b "dat_0d7b"

dat_0d7b:
        .text "                  "
        .byte $9a,$d5,$c3,$c3,$c9,$0d               // ......

txt_0d93:
        .text "         "
        .byte $81,$20,$b9,$b9,$b9,$b9,$b9,$b9,$12,$df,$92,$20,$9a,$c2,$05,$54 // . ......... ...T
        .byte $20,$9a,$c2,$20,$81,$12,$a9,$92,$b9,$b9,$b9,$b9,$b9,$b9,$0d //  .. ...........

txt_0dbb:
        .text "          "
        .byte $b8                                   // '8' | $80 (end-of-string marker)
        .byte $b8,$b8,$b8,$b8,$b8,$a9,$20,$9a,$c2,$20,$05,$4d,$9a,$c2,$20,$81 // ...... .. .M.. .
        .byte $df,$b8,$b8,$b8,$b8,$b8,$b8,$0d       // ........

txt_0dde:
        .text "                  "
        .byte $9a,$ca,$c3,$c3,$cb,$00,$ea,$8d,$15,$03,$ad,$0e,$dc,$09,$01,$8d // ................
        .byte $10                                   // .

dat_0e01:
        // === Fill data (1 bytes, $0e01-$0e01) ===
        .byte $00                                   // .

// --- Region $2000-$2000 ---
.pc = $2000 "spr_2000"

spr_2000:
        .byte $00                                   // .

// --- Region $8dd1-$8dd1 ---
.pc = $8dd1 "dat_8dd1"

dat_8dd1:
        // === Fill data (1 bytes, $8dd1-$8dd1) ===
        .byte $00                                   // .

// --- Region $ab1f-$ab1f ---
.pc = $ab1f "dat_ab1f"

dat_ab1f:
        // === Fill data (1 bytes, $ab1f-$ab1f) ===
        .byte $00                                   // .
