// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: getPsidProperties(PsidHeader&, char*)
void getPsidProperties(PsidHeader &psidHdr_, char *os)
{
	char temp[256];
	SIDsound* sid;

	if (ted)
		sid = ted->getSidCard();

	if (sid) {
		sprintf(os, "SID engine   :%s\r\n", sid->getSidEngineName());
	} else { 
		if (!psidHdr_.tracks) {
			strcat(os, "");
			return;
		}
	}
	std::string mType;
	switch (psidHdr_.type) {
		default:
			mType = "Other";
			break;
		case 0:
			mType = "PSID";
			break;
		case 1:
			mType = "RSID";
			break;
		case 2:
			mType = "CBM8M";
			break;
		case 3:
			mType = "TMF";
			break;
	}
	sprintf(temp,   "Type         :%s\r\n", mType.c_str());
	strcat(os, temp);
	sprintf(temp, "Chip (song)  :%s\r\n", psidHdr_.model);
	strcat(os, temp);
	sprintf(temp, "Chip (player):%s\r\n", sidModelSelect ?
		(sidModelSelect == 1 ? "SID6581" : "SID8580") : psidHdr_.model);
	strcat(os, temp);
	sprintf(temp, "Module       :%s\r\n", psidHdr_.title);
	strcat(os, temp);
	sprintf(temp, "Author       :%s\r\n", psidHdr_.author);
	strcat(os, temp);
	sprintf(temp, "Released     :%s\r\n", psidHdr_.copyright);
	strcat(os, temp);
	sprintf(temp, "Total tunes  :%u\r\n", psidHdr_.tracks);
	strcat(os, temp);
	sprintf(temp, "Default tune :%u\r\n", psidHdr_.defaultTune);
	strcat(os, temp);
	sprintf(temp, "Init         :$%04X\r\n", psidHdr_.initAddress);
	strcat(os, temp);
	sprintf(temp, "Play address :$%04X\r\n", psidHdr_.replayAddress);
	strcat(os, temp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18fef(%rip), %rax     # 0x25de0
testq %rax, %rax
je 0xcdff
movq 0xb71d0(%rax), %rdi
jmp 0xcdff
testq %rdi, %rdi
je 0xce20
movq (%rdi), %rax
callq *0x50(%rax)
leaq 0x3b3c(%rip), %rsi      # 0x1094d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3090
jmp 0xce2b
cmpl $0x0, 0x20(%r14)
je 0xd006
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl 0x654(%r14), %eax
cmpq $0x4, %rax
jae 0xce69
leaq 0x3c6b(%rip), %rdx      # 0x10ac0
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
leaq 0x3c6d(%rip), %rdx      # 0x10ad0
movq (%rdx,%rax,8), %r8
jmp 0xce76
movl $0x5, %r8d
leaq 0x3aea(%rip), %rcx      # 0x10960
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3300
movq (%rsp), %rdx
leaq 0x3ae7(%rip), %rsi      # 0x10974
leaq 0x20(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x634(%r14), %r12
leaq 0x3ad2(%rip), %rsi      # 0x10987
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x18f15(%rip), %eax     # 0x25de8
cmpl $0x1, %eax
leaq 0x3ad0(%rip), %rcx      # 0x109ad
leaq 0x3ad1(%rip), %rdx      # 0x109b5
cmoveq %rcx, %rdx
testl %eax, %eax
cmoveq %r12, %rdx
leaq 0x3aa5(%rip), %rsi      # 0x1099a
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x34(%r14), %rdx
leaq 0x3aa8(%rip), %rsi      # 0x109bd
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x234(%r14), %rdx
leaq 0x3a98(%rip), %rsi      # 0x109d0
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x434(%r14), %rdx
leaq 0x3a88(%rip), %rsi      # 0x109e3
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x20(%r14), %edx
leaq 0x3a7b(%rip), %rsi      # 0x109f6
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x30(%r14), %edx
leaq 0x3a6e(%rip), %rsi      # 0x10a09
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x24(%r14), %edx
leaq 0x3a61(%rip), %rsi      # 0x10a1c
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x28(%r14), %edx
leaq 0x3a57(%rip), %rsi      # 0x10a32
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xd006
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3240
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xd030
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3360