// File: /workspace/github_c_makefile_star2_O2/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 0x198bf(%rip), %rax     # 0x25e00
testq %rax, %rax
je 0xc56e
movq 0xb71d0(%rax), %rdi
testq %rdi, %rdi
je 0xc56e
movq (%rdi), %rax
callq *0x50(%rax)
leaq 0x340e(%rip), %rsi      # 0xf96d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3080
jmp 0xc579
cmpl $0x0, 0x20(%r14)
je 0xc72e
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x654(%r14), %eax
cmpq $0x4, %rax
jae 0xc5a7
leaq 0x3536(%rip), %rcx      # 0xfad4
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0xc5ae
leaq 0x33d2(%rip), %rsi      # 0xf980
movq %rsp, %rdi
callq 0x3390
movq %rsp, %r15
movq (%r15), %rdx
leaq 0x33d1(%rip), %rsi      # 0xf994
leaq 0x20(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
leaq 0x634(%r14), %r13
leaq 0x33bc(%rip), %rsi      # 0xf9a7
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
movl 0x197ff(%rip), %eax     # 0x25e08
cmpl $0x1, %eax
leaq 0x33ba(%rip), %rcx      # 0xf9cd
leaq 0x33bb(%rip), %rdx      # 0xf9d5
cmoveq %rcx, %rdx
testl %eax, %eax
cmoveq %r13, %rdx
leaq 0x338f(%rip), %rsi      # 0xf9ba
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
leaq 0x34(%r14), %rdx
leaq 0x3392(%rip), %rsi      # 0xf9dd
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
leaq 0x234(%r14), %rdx
leaq 0x3382(%rip), %rsi      # 0xf9f0
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
leaq 0x434(%r14), %rdx
leaq 0x3372(%rip), %rsi      # 0xfa03
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
movl 0x20(%r14), %edx
leaq 0x3365(%rip), %rsi      # 0xfa16
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
movl 0x30(%r14), %edx
leaq 0x3358(%rip), %rsi      # 0xfa29
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
movl 0x24(%r14), %edx
leaq 0x334b(%rip), %rsi      # 0xfa3c
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
movl 0x28(%r14), %edx
leaq 0x3341(%rip), %rsi      # 0xfa52
movq %r12, %rdi
xorl %eax, %eax
callq 0x3080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3350
movq %r15, %rdi
callq 0x30f0
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3340