// File: /workspace/github_cpp_makefile_star2_O1/khedoros[P]khednes/rom.cpp
// Function: rom::print_nsf_info()
void rom::print_nsf_info() {
    std::cout<<"Filename: "<<file.c_str()<<std::endl;
    std::cout<<"Filesize: "<<filesize<<std::endl;
    std::cout<<"Valid: "<<(valid?"true":"false")<<std::endl;
    printf("Init Insertion point: %04x\n",rst_addr);
    printf("Load Insertion point: %04x\n",load_addr);
    printf("Tick Insertion point: %04x\n",nmi_addr);
    printf("Extra hardware flag: %02x", header[0x7b]);
    if(header[0x07b]) {
        printf(" (Extra sound chip support specified, and I don't currently support that.)");
    }
    printf("\n");

    printf("Songs in file: %d\n", song_count);
    printf("Starting song: %d\n", song_index+1);
    printf("Load addr: %04x\nInit addr: %04x\nPlay addr: %04x\n", load_addr, rst_addr, nmi_addr);
    printf("Song name: %s\nArtist: %s\nCopyright: %s\n", &header[0x0e], &header[0x2e], &header[0x4e]);

    printf("NTSC ticks (uS): %d\nPAL ticks (uS): %d\n", ntsc_ticks, pal_ticks);

    printf("NTSC: %d\n PAL: %d\n", ntsc,pal);

    printf("Bank map\n--------\n");
    for(int i=0;i<8;++i) {
        printf("%02x ", header[0x70+i]);
    }
    printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x121bd(%rip), %r14     # 0x1bfb0
leaq 0xa798(%rip), %rsi      # 0x14592
movl $0xa, %edx
movq %r14, %rdi
callq 0x4410
movq 0x70(%rbx), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x9e2f
movq %r15, %rdi
callq 0x41c0
movq 0x1218e(%rip), %rdi     # 0x1bfb0
movq %r15, %rsi
movq %rax, %rdx
callq 0x4410
jmp 0x9e47
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x45d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4390
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4290
leaq 0xa728(%rip), %rsi      # 0x1459d
movl $0xa, %edx
movq %r14, %rdi
callq 0x4410
movl 0x8c(%rbx), %esi
movq %r14, %rdi
callq 0x45e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4390
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4290
leaq 0xa6e7(%rip), %rsi      # 0x145a8
movl $0x7, %edx
movq %r14, %rdi
callq 0x4410
movzbl 0x8(%rbx), %edx
leaq 0xa6d7(%rip), %rax      # 0x145b0
leaq 0xa6d5(%rip), %rsi      # 0x145b5
testq %rdx, %rdx
cmovneq %rax, %rsi
xorq $0x5, %rdx
movq %r14, %rdi
callq 0x4410
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4390
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4290
movl 0x94(%rbx), %esi
leaq 0xa76b(%rip), %rdi      # 0x14692
xorl %eax, %eax
callq 0x4050
movl 0xb8(%rbx), %esi
leaq 0xa773(%rip), %rdi      # 0x146ae
xorl %eax, %eax
callq 0x4050
movl 0x98(%rbx), %esi
leaq 0xa77b(%rip), %rdi      # 0x146ca
xorl %eax, %eax
callq 0x4050
movq 0x10(%rbx), %rax
movzbl 0x7b(%rax), %esi
leaq 0xa781(%rip), %rdi      # 0x146e6
xorl %eax, %eax
callq 0x4050
movq 0x10(%rbx), %rax
cmpb $0x0, 0x7b(%rax)
je 0x9f84
leaq 0xa783(%rip), %rdi      # 0x14700
xorl %eax, %eax
callq 0x4050
movl $0xa, %edi
callq 0x44c0
movl 0xbc(%rbx), %esi
leaq 0xa7b0(%rip), %rdi      # 0x1474b
xorl %eax, %eax
callq 0x4050
movl 0xc0(%rbx), %esi
incl %esi
leaq 0xa7ad(%rip), %rdi      # 0x1475e
xorl %eax, %eax
callq 0x4050
movl 0xb8(%rbx), %esi
movl 0x94(%rbx), %edx
movl 0x98(%rbx), %ecx
leaq 0xa7a0(%rip), %rdi      # 0x14771
xorl %eax, %eax
callq 0x4050
movq 0x10(%rbx), %rcx
leaq 0xe(%rcx), %rsi
leaq 0x2e(%rcx), %rdx
addq $0x4e, %rcx
leaq 0xa7b3(%rip), %rdi      # 0x147a2
xorl %eax, %eax
callq 0x4050
movl 0xc4(%rbx), %esi
movl 0xc8(%rbx), %edx
leaq 0xa7c1(%rip), %rdi      # 0x147ca
xorl %eax, %eax
callq 0x4050
movzbl 0xcd(%rbx), %esi
movzbl 0xcc(%rbx), %edx
leaq 0xa7cd(%rip), %rdi      # 0x147f2
xorl %eax, %eax
callq 0x4050
leaq 0xa888(%rip), %rdi      # 0x148bb
callq 0x4540
leaq 0xa465(%rip), %r14      # 0x144a4
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movzbl 0x70(%rax,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x4050
incq %r15
cmpq $0x8, %r15
jne 0xa042
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x44c0