// File: /workspace/github_c_makefile_star2_O3/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 0x19b0f(%rip), %rax     # 0x26df0
testq %rax, %rax
je 0xd30e
movq 0xb71d0(%rax), %rdi
testq %rdi, %rdi
je 0xd30e
movq (%rdi), %rax
callq *0x50(%rax)
leaq 0x3876(%rip), %rsi      # 0x10b75
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3090
jmp 0xd319
cmpl $0x0, 0x20(%r14)
je 0xd4f4
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl 0x654(%r14), %eax
cmpq $0x4, %rax
jae 0xd357
leaq 0x39a1(%rip), %rdx      # 0x10ce4
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
leaq 0x39a7(%rip), %rdx      # 0x10cf8
movq (%rdx,%rax,8), %r8
jmp 0xd364
movl $0x5, %r8d
leaq 0x3824(%rip), %rcx      # 0x10b88
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3300
movq (%rsp), %rdx
leaq 0x3821(%rip), %rsi      # 0x10b9c
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 0x380c(%rip), %rsi      # 0x10baf
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x19a37(%rip), %eax     # 0x26df8
cmpl $0x1, %eax
leaq 0x380a(%rip), %rcx      # 0x10bd5
leaq 0x380b(%rip), %rdx      # 0x10bdd
cmoveq %rcx, %rdx
testl %eax, %eax
cmoveq %r12, %rdx
leaq 0x37df(%rip), %rsi      # 0x10bc2
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x34(%r14), %rdx
leaq 0x37e2(%rip), %rsi      # 0x10be5
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x234(%r14), %rdx
leaq 0x37d2(%rip), %rsi      # 0x10bf8
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x434(%r14), %rdx
leaq 0x37c2(%rip), %rsi      # 0x10c0b
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x20(%r14), %edx
leaq 0x37b5(%rip), %rsi      # 0x10c1e
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x30(%r14), %edx
leaq 0x37a8(%rip), %rsi      # 0x10c31
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x24(%r14), %edx
leaq 0x379b(%rip), %rsi      # 0x10c44
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movl 0x28(%r14), %edx
leaq 0x3791(%rip), %rsi      # 0x10c5a
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xd4f4
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 0xd51e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3360