.global __trap_interrupt
.global __init_stack
.global __low_level_init
.global __do_copy_data
.global __do_clear_bss
.global main
.global __stop_progExec__
.global __ctors_end
.global get_password
.global check_password
.global __do_nothing
.global INT
.global putchar
.global getchar
.global getsn
.global puts
.global _unexpected_

.text
.org 0x10
__trap_interrupt: ret
.org 0x4400
__init_stack: mov #0x4400, r1
.org 0x4404
__low_level_init: mov &0x015c, r5
.org 0x4408
and.b #-0x1, r5
.org 0x440a
bis #0x5a08, r5
.org 0x440e
__do_copy_data: clr r15
.org 0x4410
nop
.org 0x4412
tst r15
.org 0x4414
jz 0xe
.org 0x4416
mov r5, &0x015c
.org 0x441a
decd r15
.org 0x441c
mov 0x4594(r15), 0x2400(r15)
.org 0x4422
jnz -0xc
.org 0x4424
__do_clear_bss: clr r15
.org 0x4426
nop
.org 0x4428
tst r15
.org 0x442a
jz 0xc
.org 0x442c
mov r5, &0x015c
.org 0x4430
dec r15
.org 0x4432
mov.b #0x0, 0x2400(r15)
.org 0x4436
jnz -0xa
.org 0x4438
main: add #0xff9c, r1
.org 0x443c
mov #0x44b4 , r15
.org 0x4440
call #0x4566
.org 0x4444
mov r1, r15
.org 0x4446
call #0x4480
.org 0x444a
mov r1, r15
.org 0x444c
call #0x448a
.org 0x4450
tst r15
.org 0x4452
jnz 0xa
.org 0x4454
mov #0x44d4 , r15
.org 0x4458
call #0x4566
.org 0x445c
jmp 0x12
.org 0x445e
mov #0x44f1 , r15
.org 0x4462
call #0x4566
.org 0x4466
push #0x7f
.org 0x446a
call #0x4502
.org 0x446e
incd r1
.org 0x4470
clr r15
.org 0x4472
add #0x64, r1
.org 0x4476
__stop_progExec__: bis #0xf0, r2
.org 0x447a
jmp -0x4
.org 0x447c
__ctors_end: br #0x4592
.org 0x4480
get_password: mov #0x64, r14
.org 0x4484
call #0x4556
.org 0x4488
ret
.org 0x448a
check_password: cmp #0x5447, 0x0(r15)
.org 0x4490
jnz $+0x1c
.org 0x4492
cmp #0x6b4e, 0x2(r15)
.org 0x4498
jnz $+0x14
.org 0x449a
cmp #0x5f7b, 0x4(r15)
.org 0x44a0
jne 0xa
.org 0x44a2
mov #0x1, r14
.org 0x44a4
cmp #0x3a44, 0x6(r15)
.org 0x44aa
jeq 0x2
.org 0x44ac
clr r14
.org 0x44ae
mov r14, r15
.org 0x44b0
ret
.org 0x44b2
__do_nothing: ret
.org 0x44b4
.strings: .string "Enter the password to continue."
.org 0x44d4
.string "Invalid password; try again."
.org 0x44f1
.string "Access Granted!"
.org 0x4501
.string ""
.org 0x4502
INT: mov 0x2(r1), r14
.org 0x4506
push r2
.org 0x4508
mov r14, r15
.org 0x450a
swpb r15
.org 0x450c
mov r15, r2
.org 0x450e
bis #0x8000, r2
.org 0x4512
call #0x10
.org 0x4516
pop r2
.org 0x4518
ret
.org 0x451a
putchar: decd r1
.org 0x451c
push r15
.org 0x451e
push #0x0
.org 0x4520
mov r15, 0x4(r1)
.org 0x4524
call #0x4502
.org 0x4528
mov 0x4(r1), r15
.org 0x452c
add #0x6, r1
.org 0x4530
ret
.org 0x4532
getchar: push r4
.org 0x4534
mov r1, r4
.org 0x4536
incd r4
.org 0x4538
decd r1
.org 0x453a
mov #0xfffc, r15
.org 0x453e
add r4, r15
.org 0x4540
push r15
.org 0x4542
push #0x1
.org 0x4544
call #0x4502
.org 0x4548
mov.b -0x4(r4), r15
.org 0x454c
sxt r15
.org 0x454e
add #0x6, r1
.org 0x4552
pop r4
.org 0x4554
ret
.org 0x4556
getsn: push r14
.org 0x4558
push r15
.org 0x455a
push #0x2
.org 0x455c
call #0x4502
.org 0x4560
add #0x6, r1
.org 0x4564
ret
.org 0x4566
puts: push r11
.org 0x4568
mov r15, r11
.org 0x456a
jmp 0xe
.org 0x456c
inc r11
.org 0x456e
sxt r15
.org 0x4570
push r15
.org 0x4572
push #0x0
.org 0x4574
call #0x4502
.org 0x4578
add #0x4, r1
.org 0x457a
mov.b @r11, r15
.org 0x457c
tst.b r15
.org 0x457e
jnz -0x12
.org 0x4580
push #0xa
.org 0x4584
push #0x0
.org 0x4586
call #0x4502
.org 0x458a
add #0x4, r1
.org 0x458c
clr r15
.org 0x458e
pop r11
.org 0x4590
ret
.org 0x4592
_unexpected_: reti pc
