LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Sid.cpp
// Function: SIDsound::getWaveSample(SIDsound::SIDVoice&)
inline int SIDsound::getWaveSample(SIDVoice &v)
{
	switch (v.wave) {
		case WAVE_TRI:
			return waveTriangle(v);
		case WAVE_SAW:
			return waveSaw(v);
		case WAVE_PULSE:
			return wavePulse(v);
		case WAVE_TRISAW:
			return waveTriSaw(v);
		case WAVE_TRIPULSE:
			return waveTriPulse(v);
		case WAVE_SAWPULSE:
			return waveSawPulse(v);
		case WAVE_TRISAWPULSE:
			return waveTriSawPulse(v);
		case WAVE_NOISE:
			return v.waveNoiseOut;
		case WAVE_NONE:
			if (v.accu) {
				int rv = (v.accu >> 12);
				//v.accu >>= 1;
				//return rv;
			}
		default:
			return 0x000;
	}
}

// Assembly:
movl 0x4(%rdi), %eax
decl %eax
cmpl $0x7, %eax
ja 0x965f
leaq 0x6dcd(%rip), %rcx      # 0x1032c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x5c(%rdi)
movl 0x20(%rdi), %eax
je 0x9578
movq 0x10(%rdi), %rcx
xorl 0x20(%rcx), %eax
shll $0x8, %eax
sarl $0x1f, %eax
xorl 0x20(%rdi), %eax
shrl $0xb, %eax
andl $0xfff, %eax            # imm = 0xFFF
retq
cmpl $0x0, 0x5c(%rdi)
movl 0x20(%rdi), %ecx
je 0x959a
movq 0x10(%rdi), %rax
xorl 0x20(%rax), %ecx
movl 0x20(%rdi), %eax
shll $0x8, %ecx
sarl $0x1f, %ecx
xorl %eax, %ecx
shrl $0xb, %ecx
xorl %edx, %edx
cmpl 0x34(%rdi), %eax
movl $0xfff, %eax            # imm = 0xFFF
cmovbl %edx, %eax
orl 0x60(%rdi), %eax
jmp 0x95db
cmpl $0x0, 0x5c(%rdi)
movl 0x20(%rdi), %ecx
je 0x95ca
movq 0x10(%rdi), %rax
xorl 0x20(%rax), %ecx
movl 0x20(%rdi), %eax
shll $0x8, %ecx
sarl $0x1f, %ecx
xorl %eax, %ecx
shrl $0xb, %ecx
shrl $0xc, %eax
andl %ecx, %eax
jmp 0x9651
movl 0x20(%rdi), %eax
xorl %ecx, %ecx
cmpl 0x34(%rdi), %eax
movl $0xfff, %eax            # imm = 0xFFF
cmovbl %ecx, %eax
orl 0x60(%rdi), %eax
retq
movl 0x2c(%rdi), %eax
retq
movl 0x20(%rdi), %eax
shrl $0xc, %eax
retq
movl 0x20(%rdi), %eax
movl %eax, %ecx
shrl $0xc, %ecx
xorl %edx, %edx
cmpl 0x34(%rdi), %eax
movl $0xfff, %eax            # imm = 0xFFF
cmovbl %edx, %eax
orl 0x60(%rdi), %eax
andl %ecx, %eax
jmp 0x9656
cmpl $0x0, 0x5c(%rdi)
movl 0x20(%rdi), %ecx
je 0x962a
movq 0x10(%rdi), %rax
xorl 0x20(%rax), %ecx
movl 0x20(%rdi), %edx
shll $0x8, %ecx
sarl $0x1f, %ecx
xorl %edx, %ecx
shrl $0xb, %ecx
movl %edx, %eax
shrl $0xc, %eax
xorl %esi, %esi
cmpl 0x34(%rdi), %edx
movl $0xfff, %edx            # imm = 0xFFF
cmovbl %esi, %edx
orl 0x60(%rdi), %edx
andl %ecx, %eax
andl %edx, %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, %ecx
shrl %ecx
addl %eax, %eax
andl %ecx, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/SIDSoundLib.cpp
// Function: SIDSoundLib::SIDSoundLib(unsigned int)
SIDSoundLib::SIDSoundLib(unsigned int model) : SIDsound(model, 0)
{
	if (!detected)
		connect();
	if (detected) {
		sidCreate(sidBaseFreq, model, sidBaseFreq);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
xorl %edx, %edx
callq 0x8b90
leaq 0xa433(%rip), %rax      # 0x13cb8
movq %rax, (%rbx)
cmpb $0x0, 0x1bb89(%rip)     # 0x25418
jne 0x9896
callq 0x96a8
cmpb $0x1, 0x1bb7b(%rip)     # 0x25418
jne 0x98af
movl 0x41c0(%rbx), %edi
movl %ebp, %esi
movl %edi, %edx
callq *0x1bb79(%rip)          # 0x25428
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x9512
movq %r14, %rdi
callq 0x3360
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/SIDSoundLib.cpp
// Function: SIDSoundLib::~SIDSoundLib()
SIDSoundLib::~SIDSoundLib()
{
	sidDestroy();
	CLOSE_LIBRARY(m_hDll);
	m_hDll = NULL;
	detected = false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xa3e5(%rip), %rax      # 0x13cb8
movq %rax, (%rdi)
callq *0x1bb54(%rip)          # 0x25430
movq 0x1bb3d(%rip), %rdi     # 0x25420
callq 0x31a0
movq $0x0, 0x1bb2d(%rip) # 0x25420
movb $0x0, 0x1bb1e(%rip)     # 0x25418
movq %rbx, %rdi
popq %rbx
jmp 0x9512
movq %rax, %rdi
callq 0x3de3
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/SIDSoundLib.cpp
// Function: SIDSoundLib::setModel(unsigned int)
void SIDSoundLib::setModel(unsigned int model)
{
	if (model_ != model) {
		sidSetModel(model);
		sidReset();
		model_ = model;
	}
}

// Assembly:
cmpl %esi, 0x41bc(%rdi)
je 0x995f
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
callq *0x1baf5(%rip)          # 0x25440
callq *0x1baf7(%rip)          # 0x25448
movl %ebx, 0x41bc(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::enableSidCard(unsigned int, unsigned int)
unsigned int TED::enableSidCard(unsigned int sidEmuType_, unsigned int disableMask)
{
	if (sidEmuType_) {
		if (sidEmuType != sidEmuType_) {
			delete sidCard;
			sidCard = 0;
		} else
			return sidEmuType;
		if (sidEmuType_ == 2 && SIDSoundLib::connect()) {
			sidCard = new SIDSoundLib(SID8580);
			sidEmuType = 2;
		}
		else {
			sidCard = new SIDsound(SID8580, disableMask);
			sidEmuType = 1;
		}
		sidCard->setSampleRate(TED_SOUND_CLOCK);
	} else {
		if (!sidCard)
			return 0;
		delete sidCard;
		sidCard = 0;
		sidEmuType = 0;
	}
	return sidEmuType;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x9bcd
movl %esi, %r14d
movl 0xb71d8(%rbx), %eax
cmpl %esi, %eax
je 0x9c3e
movl %edx, %ebp
movq 0xb71d0(%rbx), %rdi
testq %rdi, %rdi
je 0x9b91
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xb71d0(%rbx)
cmpl $0x2, %r14d
jne 0x9bf6
callq 0x96a8
testb %al, %al
je 0x9bf6
movl $0x41c8, %edi           # imm = 0x41C8
callq 0x3230
movq %rax, %r14
movl $0x2, %r15d
movq %rax, %rdi
movl $0x1, %esi
callq 0x986e
jmp 0x9c18
movq 0xb71d0(%rbx), %rdi
testq %rdi, %rdi
je 0x9c3c
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xb71d0(%rbx)
movl $0x0, 0xb71d8(%rbx)
jmp 0x9c34
movl $0x41c8, %edi           # imm = 0x41C8
callq 0x3230
movq %rax, %r14
movl $0x1, %r15d
movq %rax, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x8b90
movq %r14, 0xb71d0(%rbx)
movl %r15d, 0xb71d8(%rbx)
movq (%r14), %rax
movq %r14, %rdi
movl $0x361f0, %esi          # imm = 0x361F0
callq *0x30(%rax)
movl 0xb71d8(%rbx), %eax
jmp 0x9c3e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9c4b
movq %rax, %rbx
movl $0x41c8, %esi           # imm = 0x41C8
movq %r14, %rdi
callq 0x3240
movq %rbx, %rdi
callq 0x3360
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::Reset()
void TED::Reset()
{
	// clear RAM with powerup pattern
	for (int i = 0; i < RAMSIZE; i++)
		Ram[i] = (i >> 1) << 1 == i ? 0 : 0xFF;
	// reset oscillators
	oscillatorReset();
	if (sidCard) sidCard->reset();
	lastResetCycle = CycleCounter;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movl %eax, %ecx
andb $0x1, %cl
negb %cl
movb %cl, 0x45fc0(%rbx,%rax)
incq %rax
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x9c6a
movq %rbx, %rdi
callq 0xbbe0
movq 0xb71d0(%rbx), %rdi
testq %rdi, %rdi
je 0x9c9d
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x1b7d4(%rip), %rax     # 0x25478
movq %rax, 0xb61a0(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::ChangeMemBankSetup(bool)
void TED::ChangeMemBankSetup(bool romoff)
{
	if (romoff) {
		mem_8000_bfff = actram + (0x8000 & RAMMask);
		mem_fc00_fcff = mem_c000_ffff = actram + (0xC000 & RAMMask);
	} else {
		mem_8000_bfff = actromlo;
		mem_c000_ffff = actromhi;
		mem_fc00_fcff = &(RomHi[0][0]);
	}
}

// Assembly:
testl %esi, %esi
je 0x9d04
movq 0xb6010(%rdi), %rcx
movl 0x76008(%rdi), %eax
movl %eax, %edx
andl $0x8000, %edx           # imm = 0x8000
addq %rcx, %rdx
movq %rdx, 0x75ff0(%rdi)
andl $0xc000, %eax           # imm = 0xC000
addq %rcx, %rax
movq %rax, 0x75ff8(%rdi)
jmp 0x9d19
movups 0x75fe0(%rdi), %xmm0
movups %xmm0, 0x75ff0(%rdi)
leaq 0x55fc0(%rdi), %rax
movq %rax, 0x76000(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::texttoscreen(int, int, char const*)
void TED::texttoscreen(int x,int y, const char *scrtxt)
{
	int i =0;

	while (scrtxt[i]) {
		chrtoscreen(x + i * 8, y, scrtxt[i]);
		i++;
	}
}

// Assembly:
movb (%rcx), %al
testb %al, %al
je 0x9d64
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
incq %rbx
movsbl %al, %ecx
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x9d66
movb (%rbx), %al
addl $0x8, %r14d
incq %rbx
testb %al, %al
jne 0x9d3d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::chrtoscreen(int, int, char)
void TED::chrtoscreen(int x,int y, char scrchr)
{
	int j, k;
	unsigned char *charset = (unsigned char *) kernal+0x1000;

	if (isalpha(scrchr)) {
		scrchr=toupper(scrchr)-64;
		charset+=(scrchr<<3);
		for (j=0;j<8;j++)
			for (k=0;k<8;k++)
				(*(charset+j) & (0x80>>k)) ? screen[(y+j)*456+x+k]=0x00 : screen[(y+j)*456+x+k]=0x71;
		return;
	}
	charset+=(scrchr<<3);
	for (j=0;j<8;j++)
		for (k=0;k<8;k++)
			(*(charset+j) & (0x80>>k)) ? screen[(y+j)*456+x+k]=0x00 : screen[(y+j)*456+x+k]=0x71;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movl %ecx, %edi
callq 0x3320
testl %eax, %eax
je 0x9e07
movl %r15d, %edi
callq 0x3390
shll $0x18, %eax
addl $0xc0000000, %eax       # imm = 0xC0000000
sarl $0x15, %eax
cltq
leaq 0xe46d(%rip), %rcx      # 0x18210
addq %rcx, %rax
addq $0x1000, %rax           # imm = 0x1000
movslq %r14d, %rdx
movslq %ebp, %rsi
xorl %edi, %edi
movl $0x71, %r8d
movzbl (%rax,%rdi), %r9d
leaq (%rdi,%rdx), %rcx
imulq $0x1c8, %rcx, %r10      # imm = 0x1C8
addq %rsi, %r10
xorl %ecx, %ecx
movl %r9d, %r11d
shll %cl, %r11d
testb %r11b, %r11b
movq %r10, %r11
cmovnsq %r10, %r11
movl $0x0, %ebp
cmovnsl %r8d, %ebp
addq %rbx, %r11
movb %bpl, 0x824(%rcx,%r11)
incq %rcx
cmpq $0x8, %rcx
jne 0x9dcf
incq %rdi
cmpq $0x8, %rdi
jne 0x9dba
jmp 0x9e74
movslq %r15d, %rax
leaq 0xe3ff(%rip), %rcx      # 0x18210
leaq (%rcx,%rax,8), %rax
addq $0x1000, %rax           # imm = 0x1000
movslq %r14d, %rdx
movslq %ebp, %rsi
xorl %edi, %edi
movl $0x71, %r8d
movzbl (%rax,%rdi), %r9d
leaq (%rdi,%rdx), %rcx
imulq $0x1c8, %rcx, %r10      # imm = 0x1C8
addq %rsi, %r10
xorl %ecx, %ecx
movl %r9d, %r11d
shll %cl, %r11d
testb %r11b, %r11b
movq %r10, %r11
cmovnsq %r10, %r11
movl $0x0, %ebp
cmovnsl %r8d, %ebp
addq %rbx, %r11
movb %bpl, 0x824(%rcx,%r11)
incq %rcx
cmpq $0x8, %rcx
jne 0x9e3e
incq %rdi
cmpq $0x8, %rdi
jne 0x9e29
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::loadroms()
void TED::loadroms()
{
	for (int i=0;i<4;i++) {
		loadhiromfromfile(i,romhighpath[i]);
		loadloromfromfile(i,romlopath[i]);
	}
	mem_8000_bfff = actromlo = &(RomLo[0][0]);
	mem_fc00_fcff = mem_c000_ffff = actromhi = &(RomHi[0][0]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x41b(%rdi), %r14
xorl %r15d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x9efa
leaq -0x400(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x9fe4
incq %r15
addq $0x100, %r14            # imm = 0x100
cmpq $0x4, %r15
jne 0x9e92
leaq 0x65fe0(%rbx), %rax
movq %rax, 0x75fe0(%rbx)
movq %rax, 0x75ff0(%rbx)
leaq 0x55fc0(%rbx), %rax
movq %rax, 0x75fe8(%rbx)
movq %rax, 0x75ff8(%rbx)
movq %rax, 0x76000(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::loadhiromfromfile(int, char*)
void TED::loadhiromfromfile(int nr, char fname[512])
{
	FILE	*img;

	if (fname[0]!='\0') {
		if (img = fopen(fname, "rb")) {
			// load high ROM file
			fread(&(RomHi[nr]),ROMSIZE,1,img);
			fclose(img);
			return;
		}
		switch (nr) {
			case 0:
				memcpy(&(RomHi[0]),kernal,ROMSIZE);
				break;
			case 1: if (!strncmp(fname,"3PLUS1HIGH",10))
						memcpy(&(RomHi[1]),plus4hi,ROMSIZE);
					else
						memset(&(RomHi[1]),0,ROMSIZE);
				break;
			default : memset(&(RomHi[nr]),0,ROMSIZE);
		}
	} else
		memset(&(RomHi[nr]),0,ROMSIZE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x0, (%rdx)
je 0x9f74
movq %rdx, %r14
leaq 0x51f7(%rip), %rsi      # 0xf10c
movq %rdx, %rdi
callq 0x3270
testq %rax, %rax
je 0x9f5b
movq %rax, %r15
movslq %ebp, %rax
shlq $0xe, %rax
leaq (%rbx,%rax), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
movl $0x4000, %esi           # imm = 0x4000
movl $0x1, %edx
movq %r15, %rcx
callq 0x32e0
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3220
cmpl $0x1, %ebp
je 0x9f9c
testl %ebp, %ebp
jne 0x9f74
addq $0x55fc0, %rbx          # imm = 0x55FC0
leaq 0xe29e(%rip), %rsi      # 0x18210
jmp 0x9fcc
movslq %ebp, %rax
shlq $0xe, %rax
leaq (%rbx,%rax), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
movl $0x4000, %edx           # imm = 0x4000
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3130
leaq 0x6705(%rip), %rsi      # 0x106a8
movl $0xa, %edx
movq %r14, %rdi
callq 0x3100
addq $0x59fc0, %rbx          # imm = 0x59FC0
testl %eax, %eax
je 0x9fc5
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
jmp 0x9f8b
leaq 0x12244(%rip), %rsi     # 0x1c210
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::loadloromfromfile(int, char*)
void TED::loadloromfromfile(int nr, char fname[512])
{
	FILE			*img;

	if (fname[0]!='\0') {
		if (img = fopen(fname, "rb")) {
			// load low ROM file
			fread(&(RomLo[nr]),ROMSIZE,1,img);
			fclose(img);
			return;
		}
		switch (nr) {
			case 0: memcpy(&(RomLo[0]),basic,ROMSIZE);
				break;
			case 1: if (!strncmp(fname,"3PLUS1LOW",9))
						memcpy(&(RomLo[1]),plus4lo,ROMSIZE);
					else
						memset(&(RomLo[1]),0,ROMSIZE);
				break;
			default : memset(&(RomLo[nr]),0,ROMSIZE);
		}
	} else
		memset(&(RomLo[nr]),0,ROMSIZE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x0, (%rdx)
je 0xa05e
movq %rdx, %r14
leaq 0x510d(%rip), %rsi      # 0xf10c
movq %rdx, %rdi
callq 0x3270
testq %rax, %rax
je 0xa045
movq %rax, %r15
movslq %ebp, %rax
shlq $0xe, %rax
leaq (%rbx,%rax), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
movl $0x4000, %esi           # imm = 0x4000
movl $0x1, %edx
movq %r15, %rcx
callq 0x32e0
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3220
cmpl $0x1, %ebp
je 0xa086
testl %ebp, %ebp
jne 0xa05e
addq $0x65fe0, %rbx          # imm = 0x65FE0
leaq 0xa1b4(%rip), %rsi      # 0x14210
jmp 0xa0b6
movslq %ebp, %rax
shlq $0xe, %rax
leaq (%rbx,%rax), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
movl $0x4000, %edx           # imm = 0x4000
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3130
leaq 0x6611(%rip), %rsi      # 0x1069e
movl $0x9, %edx
movq %r14, %rdi
callq 0x3100
addq $0x69fe0, %rbx          # imm = 0x69FE0
testl %eax, %eax
je 0xa0af
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
jmp 0xa075
leaq 0x1615a(%rip), %rsi     # 0x20210
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::copyToKbBuffer(char*, unsigned int)
void TED::copyToKbBuffer(char *bufferString, unsigned int bufferLength)
{
	unsigned int bufferAddress = 0x0527;
	if (bufferLength == -1U) bufferLength = (unsigned int) strlen(bufferString);

	for (unsigned int i=0; i < bufferLength; i++)
		Write( bufferAddress + i, bufferString[i]);

	Write(0xEF, bufferLength);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
cmpl $-0x1, %edx
jne 0xa124
movq %r14, %rdi
callq 0x30f0
movq %rax, %r15
testl %r15d, %r15d
je 0xa14b
movl %r15d, %r12d
xorl %r13d, %r13d
leal 0x527(%r13), %esi
movzbl (%r14,%r13), %edx
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
incq %r13
cmpq %r13, %r12
jne 0xa12f
movq (%rbx), %rax
movq (%rax), %rax
movzbl %r15b, %edx
movq %rbx, %rdi
movl $0xef, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::~TED()
TED::~TED()
{
	if (filter)
		delete filter;

	if (sidCard)
		enableSidCard(0, 0);

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x81b1(%rip), %rax      # 0x13d38
movq %rax, (%rdi)
movq 0x65fd8(%rdi), %rdi
testq %rdi, %rdi
je 0xbb9c
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xb71d0(%rbx), %rdi
testq %rdi, %rdi
je 0xbbc3
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xb71d0(%rbx)
movl $0x0, 0xb71d8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::oscillatorReset()
void TED::oscillatorReset()
{
	FlipFlop[0] = dcOutput[0] = 0;
	FlipFlop[1] = dcOutput[1] = 0;
	oscCount[0] = 0;
	oscCount[1] = 0;
	NoiseCounter = 0;
	Freq1 = Freq2 = 0;
	DAStatus = Snd1Status = Snd2Status = SndNoiseStatus = 0;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x198fc(%rip)     # 0x254e4
movl %eax, 0x198fe(%rip)     # 0x254ec
movl %eax, 0x198f4(%rip)     # 0x254e8
movl %eax, 0x198f6(%rip)     # 0x254f0
movq $0x0, 0x198ef(%rip) # 0x254f4
movl %eax, 0x198f1(%rip)     # 0x254fc
movw %ax, 0x198ee(%rip)      # 0x25500
movw %ax, 0x198e9(%rip)      # 0x25502
movl %eax, 0x198e5(%rip)     # 0x25504
movl %eax, 0x198e3(%rip)     # 0x25508
movl %eax, 0x198e1(%rip)     # 0x2550c
movl %eax, 0x198df(%rip)     # 0x25510
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::oscillatorInit()
void TED::oscillatorInit()
{
	unsigned int i;

	oscillatorReset();

	int im = 0xff;
    for (i = 0; i < 256; i++) {
		im = (im << 1) | (((im >> 7) ^ (im >> 5) ^ (im >> 4) ^ (im >> 1)) & 1);
		noise[i] = im & 1;
    }
	for (i = 0; i < 64; i++) {
		int chdbl = (i & 0x30) == 0x30;
		int vol = ((i & 0x0F) < 9 ? (i & 0x0F) : 8);
		int nonl = ((chdbl && vol > 1) ? vol * vol * 54 - 173 * vol + 162 : 0);
		volumeTable[i] = (vol && i & 0x30) ?
			(nonl + (586 + (vol - 1) * 1024) << (chdbl ? 1 : 0)) : 0;
	}
	oscStep = (1 << PRECISION) << 0;

	// set player specific parameters
	waveForm[0] = waveForm[1] = 1;
	masterVolume = AMP(8);
	setplaybackSpeed(3);
	enableChannel(0, true);
	enableChannel(1, true);
	enableChannel(2, true);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movl %eax, 0x198a6(%rip)     # 0x254e4
movl %eax, 0x198a8(%rip)     # 0x254ec
movl %eax, 0x1989e(%rip)     # 0x254e8
movl %eax, 0x198a0(%rip)     # 0x254f0
movq $0x0, 0x19899(%rip) # 0x254f4
movl %eax, 0x1989b(%rip)     # 0x254fc
movw %ax, 0x19898(%rip)      # 0x25500
movw %ax, 0x19893(%rip)      # 0x25502
movl %eax, 0x1988f(%rip)     # 0x25504
movl %eax, 0x1988d(%rip)     # 0x25508
movl %eax, 0x1988b(%rip)     # 0x2550c
movl %eax, 0x19889(%rip)     # 0x25510
movl $0xff, %ecx
leaq 0x1988d(%rip), %rdx     # 0x25520
movl %ecx, %esi
shrl $0x7, %esi
movl %ecx, %edi
shrl $0x5, %edi
xorl %esi, %edi
movl %ecx, %esi
shrl $0x4, %esi
movl %ecx, %r8d
shrl %r8d
xorl %esi, %r8d
xorl %edi, %r8d
andl $0x1, %r8d
leal (%r8,%rcx,2), %ecx
movb %r8b, (%rax,%rdx)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0xbc93
leaq 0x19952(%rip), %rax     # 0x25620
xorl %edx, %edx
xorl %esi, %esi
movl %esi, %edi
andl $0xf, %edi
sete %r8b
movl %esi, %ecx
andl $0x30, %ecx
sete %r9b
orb %r8b, %r9b
movl $0x0, %r8d
jne 0xbd34
cmpl $0x8, %edi
movl $0x8, %r8d
cmovbl %edi, %r8d
imull $0x36, %r8d, %r9d
addl $0xffffff53, %r9d       # imm = 0xFFFFFF53
imull %r8d, %r9d
addl $0xa2, %r9d
cmpl $0x2, %edi
cmovbl %edx, %r9d
cmpl $0x30, %ecx
sete %cl
cmovnel %edx, %r9d
shll $0xa, %r8d
addl %r9d, %r8d
addl $0xfffffe4a, %r8d       # imm = 0xFFFFFE4A
shll %cl, %r8d
movl %r8d, (%rax)
incq %rsi
addq $0x4, %rax
cmpq $0x40, %rsi
jne 0xbcd2
movb $0x1, 0x199d5(%rip)     # 0x25720
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xb61b0(%rbx)
movl $0x180, 0x1977a(%rip)   # imm = 0x180
movl $0x4, 0xb71b8(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xbb42
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0xbb42
movq %rbx, %rdi
movl $0x2, %esi
movl $0x1, %edx
popq %rbx
jmp 0xbb42
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::writeSoundReg(unsigned int, unsigned char)
void TED::writeSoundReg(unsigned int reg, unsigned char value)
{
#if defined(_DEBUG) && 0
	static FILE *f = std::fopen("freqlog.txt", "a");
	if (f)
		std::fprintf(f, "%04X <- %02X in cycle %llu", 0xff0e + reg, value, CycleCounter);
	fprintf(f, "\n");
#endif

	switch (reg) {
		case 0:
			Freq1 = (Freq1 & 0x300) | value;
			setFreq(0, Freq1);
			break;
		case 1:
			Freq2 = (Freq2 & 0x300) | value;
			setFreq(1, Freq2);
			break;
		case 2:
			Freq2 = (Freq2 & 0xFF) | (value << 8);
			setFreq(1, Freq2);
			break;
		case 3:
			if ((DAStatus = value & 0x80)) {
				FlipFlop[0] = 1;
				FlipFlop[1] = 1;
				oscCount[0] = OscReload[0];
				oscCount[1] = OscReload[1];
				NoiseCounter = 0;
			}
			Volume = value & 0x0F;
			if (Volume > 8) Volume = 8;
			Volume = (Volume << 9);
			Snd1Status = value & 0x10;
			Snd2Status = value & 0x20;
			SndNoiseStatus = value & 0x40;
			break;
		case 4:
			Freq1 = (Freq1 & 0xFF) | (value << 8);
			setFreq(0, Freq1);
			break;
	}
}

// Assembly:
cmpl $0x4, %esi
ja 0xbe39
movl %esi, %eax
leaq 0x48f6(%rip), %rcx      # 0x106d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0x19718(%rip), %eax     # 0x25502
andl $0x300, %eax            # imm = 0x300
movzbl %dl, %ecx
leal (%rax,%rcx), %edx
movw %dx, 0x19706(%rip)      # 0x25502
jmp 0xbe18
movzbl 0x196fd(%rip), %eax     # 0x25502
movzbl %dl, %ecx
shll $0x8, %ecx
leal (%rax,%rcx), %edx
movw %dx, 0x196ed(%rip)      # 0x25502
movzwl %dx, %edx
xorl %esi, %esi
cmpl $0x3fe, %edx            # imm = 0x3FE
sete %sil
movl %esi, 0x196ba(%rip)     # 0x254e4
addl %ecx, %eax
incl %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, 0x198eb(%rip)     # 0x25724
retq
movzbl 0x196bf(%rip), %eax     # 0x25500
movzbl %dl, %ecx
shll $0x8, %ecx
leal (%rax,%rcx), %edx
movw %dx, 0x196af(%rip)      # 0x25500
movzwl %dx, %edx
jmp 0xbee7
movzbl %dl, %eax
movl %eax, %ecx
andl $0x80, %ecx
movl %ecx, 0x196a6(%rip)     # 0x25510
je 0xbe95
movl $0x1, %ecx
movl %ecx, 0x19675(%rip)     # 0x254ec
movl %ecx, 0x19673(%rip)     # 0x254f0
movq 0x198a0(%rip), %rcx     # 0x25724
movq %rcx, 0x19669(%rip)     # 0x254f4
movl $0x0, 0x19667(%rip)     # 0x254fc
movl %eax, %ecx
andl $0xf, %ecx
cmpl $0x8, %ecx
movl $0x8, %edx
cmovbl %ecx, %edx
shll $0x9, %edx
movl %edx, 0x1987e(%rip)     # 0x2572c
movl %eax, %ecx
andl $0x10, %ecx
movl %ecx, 0x19653(%rip)     # 0x2550c
movl %eax, %ecx
andl $0x20, %ecx
movl %ecx, 0x19644(%rip)     # 0x25508
andl $0x40, %eax
movl %eax, 0x19637(%rip)     # 0x25504
retq
movzwl 0x1962b(%rip), %eax     # 0x25500
andl $0x300, %eax            # imm = 0x300
movzbl %dl, %ecx
leal (%rax,%rcx), %edx
movw %dx, 0x19619(%rip)      # 0x25500
xorl %esi, %esi
cmpl $0x3fe, %edx            # imm = 0x3FE
sete %sil
movl %esi, 0x195ef(%rip)     # 0x254e8
addl %ecx, %eax
incl %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, 0x19820(%rip)     # 0x25728
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::storeToBuffer(short*, unsigned int)
void TED::storeToBuffer(short *buffer, unsigned int count)
{
	static double			lp_accu = 0;
	static double			hp_accu = 0;

	const double hptc = 20000.0/1000000;		// 6000us (est) maybe 7000 ?
	const double hpc = 1.0/(hptc * sampleRate * 2.0);	// 2*pi*fc=1/tau..
	
	// TODO: a proper windowed lowpass FIR filter
#if 0
	const double lpc = 1.0 - exp( - double(sampleRate) / 2.0 / double(TED_SOUND_CLOCK));
	do {
		double accu = (double) *buffer;
		// apply low pass filter -> lp_accu = lpc*accu + (1-lpc)*lp_accu
		lp_accu += lpc * (accu - lp_accu);
		accu = lp_accu - hp_accu;
		// update hp filter pole
		hp_accu +=  hpc * accu;
		// fill the buffer
		*buffer++ = ((short)accu);
	} while(--count);
#else
	do {
		double accu = (double) filter->lowPass(*buffer);
		accu = accu - hp_accu;
		// update hp filter pole
		hp_accu +=  hpc * accu;
		// fill the buffer
		*buffer++ = (short)accu;
	} while(--count);
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xb71c8(%rdi), %eax
cvtsi2sd %rax, %xmm0
movq %rsi, %r14
mulsd 0x47dd(%rip), %xmm0     # 0x10708
addsd %xmm0, %xmm0
movsd 0x30d9(%rip), %xmm1     # 0xf010
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movl %edx, %r15d
xorl %r12d, %r12d
movq 0x65fd8(%rbx), %rdi
movswl (%r14,%r12,2), %esi
callq 0x873e
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x197c9(%rip), %xmm1    # 0x25730
subsd %xmm1, %xmm0
movsd (%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm0, %eax
movsd %xmm2, 0x197ac(%rip)    # 0x25730
movw %ax, (%r14,%r12,2)
incq %r12
cmpl %r12d, %r15d
jne 0xbf46
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::setMasterVolume(unsigned int)
void TED::setMasterVolume(unsigned int shift)
{
	if (!shift)
		masterVolume = 0;
	else
		masterVolume = AMP(shift);
}

// Assembly:
testl %esi, %esi
je 0xc2a6
pushq %rax
movl %esi, %eax
cvtsi2sd %rax, %xmm0
movsd 0x3dfa(%rip), %xmm1     # 0x10088
callq 0x3350
mulsd 0x4475(%rip), %xmm0     # 0x10710
cvttsd2si %xmm0, %rax
addq $0x8, %rsp
jmp 0xc2a8
xorl %eax, %eax
movl %eax, 0x19232(%rip)     # 0x254e0
retq
nop
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::initFilter(unsigned int, unsigned int)
void TED::initFilter(unsigned int sampleRate_, unsigned int filterOrder_)
{
	if (filter)
		delete filter;
	filter = new Filter(sampleRate_ / 2, TED_SOUND_CLOCK, filterOrder_);
	filter->reCalcWindowTable();
	filterOrder = filterOrder_;
	sampleRate = sampleRate_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movq 0x65fd8(%rdi), %rdi
testq %rdi, %rdi
je 0xc32e
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x50, %edi
callq 0x3230
movq %rax, %r15
movl %ebx, %esi
shrl %esi
movq %rax, %rdi
movl $0x361f0, %edx          # imm = 0x361F0
movl %ebp, %ecx
callq 0x82f4
movq %r15, 0x65fd8(%r14)
movq %r15, %rdi
callq 0x834c
movl %ebp, 0xb71cc(%r14)
movl %ebx, 0xb71c8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x50, %esi
movq %r15, %rdi
callq 0x3240
movq %rbx, %rdi
callq 0x3360
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedShowScreenData(char*)
void tedShowScreenData(char* out)
{
	const bool isCaps = !(ted->Read(0xFF13) & 4);
	const unsigned int pageAddr = (ted->Read(0xFF14) & 0xF8) << 8;
	unsigned char* in = ted->Ram + (pageAddr | 0x400);
	unsigned int i, j;
	for (i = 0; i < 25; i++) {
		for (j = 0; j < 40; j++) {
			*out++ = convertToAscii(*in, isCaps);
			in++;
		}
		*out++ = '\r';
		*out++ = '\n';
	}
	*out++ = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x1920b(%rip), %rdi     # 0x25de0
movq (%rdi), %rax
movl $0xff13, %esi           # imm = 0xFF13
callq *0x8(%rax)
movl %eax, %ebx
movq 0x191f7(%rip), %rdi     # 0x25de0
movq (%rdi), %rax
movl $0xff14, %esi           # imm = 0xFF14
callq *0x8(%rax)
andb $-0x8, %al
movzbl %al, %eax
shll $0x8, %eax
movq 0x191dd(%rip), %rcx     # 0x25de0
leaq (%rcx,%rax), %r15
addq $0x463c0, %r15          # imm = 0x463C0
xorl %r12d, %r12d
movq %r14, %r13
xorl %ebp, %ebp
xorl %esi, %esi
testb $0x4, %bl
sete %sil
movzbl (%r15,%rbp), %edi
callq 0xcc69
movb %al, (%r13,%rbp)
incq %rbp
cmpl $0x28, %ebp
jne 0xcc16
leaq 0x2(,%rbp), %r14
addq %r13, %r14
movw $0xa0d, -0x2(%r14)      # imm = 0xA0D
incl %r12d
addq %rbp, %r15
cmpl $0x19, %r12d
jne 0xcc11
movb $0x0, 0x2(%r13,%rbp)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: convertToAscii(unsigned char, bool)
static char convertToAscii(unsigned char c, bool isCaps)
{
	char rv = 0x20;
	
	if (c == 0)
		rv = ' ';
	else if (isCaps) {
		if (c <= 0x1F)
			rv = c ^ 0x40;
		else if (c >= 0x60 && c <= 0x7F)
			rv = c - 0x20;
		else
			rv = c;
	}
	else {
		if (c >= 0x01 && c <= 0x1A)
			rv = c ^ 0x60;
		else if (c >= 0x1B && c <= 0x1F)
			rv = c ^ 0x40;
		else if (c == 0)
			rv = 64;
		else if (c >= 0x41 && c <= 0x5A)
			rv = c ^ 0x20;
		else if (c >= 0xC1 && c <= 0xDA)
			rv = c ^ 0x80;
		else
			rv = c;
	}
	return rv;
}

// Assembly:
testl %edi, %edi
je 0xcc87
movl %edi, %eax
testb %sil, %sil
je 0xcc8a
cmpb $0x1f, %al
jbe 0xcc95
leal -0x20(%rax), %ecx
cmpb $0x60, %al
movzbl %al, %edx
movzbl %cl, %eax
cmovll %edx, %eax
retq
movb $0x20, %al
retq
cmpb $0x1a, %al
ja 0xcc91
orb $0x60, %al
retq
cmpb $0x1f, %al
ja 0xcc98
orb $0x40, %al
retq
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
ja 0xcca3
orb $0x20, %al
retq
leal 0x3f(%rax), %ecx
movzbl %al, %edx
andb $0x5f, %al
cmpb $0x1a, %cl
movzbl %al, %eax
cmovael %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: trimTrailingSpace(char*, unsigned int)
char *trimTrailingSpace(char* str, unsigned int maxSize)
{
	size_t sln = strlen(str);
	size_t actualLen = maxSize < sln ? maxSize : sln;

	// Trim trailing space
	char *end = str + actualLen - 1;
	while (end > str && isspace(*end)) end--;

	// Write new null terminator character
	end[1] = '\0';

	return str;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x30f0
movl %ebp, %ecx
cmpq %rcx, %rax
cmovbq %rax, %rcx
addq %rbx, %rcx
decq %rcx
movq %rcx, %r14
cmpq %rbx, %rcx
jbe 0xcceb
movsbl (%r14), %edi
callq 0x3060
leaq -0x1(%r14), %rcx
testl %eax, %eax
jne 0xccd2
movb $0x0, 0x1(%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: parsePsid(unsigned char*, PsidHeader&)
unsigned int parsePsid(unsigned char *buf, PsidHeader &psidHdr_)
{
	char *buffer = (char *) buf;

	if (buf) {
		memset(psidHdr_.title, 0, sizeof(psidHdr_.title));
		strncpy(psidHdr_.title, trimTrailingSpace(buffer + PSID_NAME, 32), 32);
		psidHdr_.title[PSID_NAME + 32] = 0;
		strncpy(psidHdr_.author, trimTrailingSpace(buffer + PSID_AUTHOR, 32), 32);
		psidHdr_.author[PSID_AUTHOR + 32] = 0;
		strncpy(psidHdr_.copyright, trimTrailingSpace(buffer + PSID_COPYRIGHT, 32), 32);
		psidHdr_.copyright[PSID_COPYRIGHT + 32] = 0;
	} else {
		memset(psidHdr_.title, 0, sizeof(psidHdr_.title));
		memset(psidHdr_.author, 0, 32);
		memset(psidHdr_.copyright, 0, 32);
		memset(psidHdr_.copyright, 0, 32);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
leaq 0x34(%rsi), %r15
testq %rdi, %rdi
je 0xcda9
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x200, %edx            # imm = 0x200
movq %r15, %rdi
xorl %esi, %esi
callq 0x3130
leaq 0x16(%r14), %r12
movq %r12, %rdi
movl $0x20, %esi
callq 0xccb5
movl $0x20, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3120
movb %bpl, 0x6a(%rbx)
leaq 0x234(%rbx), %r15
leaq 0x36(%r14), %r12
movq %r12, %rdi
movl $0x20, %esi
callq 0xccb5
movl $0x20, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3120
movb %bpl, 0x28a(%rbx)
leaq 0x434(%rbx), %r15
addq $0x56, %r14
movq %r14, %rdi
movl $0x20, %esi
callq 0xccb5
movl $0x20, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3120
movb %bpl, 0x4aa(%rbx)
jmp 0xcdc9
movl $0x220, %edx            # imm = 0x220
movq %r15, %rdi
xorl %esi, %esi
callq 0x3130
xorps %xmm0, %xmm0
movups %xmm0, 0x434(%rbx)
movups %xmm0, 0x444(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: readFile(char*, unsigned char**, unsigned long*)
unsigned int readFile(char *fName, unsigned char **bufferPtr, size_t *bLen)
{
	std::FILE *file = (std::FILE *) 0;

	if (!fName)
		return 2;

	try {
		size_t flen;
		file = std::fopen(fName, "rb");
		if (!file)
			return 3;
		std::fseek(file, 0, SEEK_END);
		flen = std::ftell(file);
		if (flen > MAX_BUFFER_SIZE) flen = MAX_BUFFER_SIZE;
		std::fseek(file, 0, SEEK_SET);
		*bufferPtr = inputBuffer;
		size_t r = std::fread(*bufferPtr, flen, 1, file);
		*bLen = flen;
		fclose(file);
	} catch(char *str) {
		std::cerr << "Error opening " << fName << std::endl;
		std::cerr << "    exception: " << str << std::endl;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xd17c
movq %rdx, %rbx
movq %rsi, %r12
leaq 0x1ff8(%rip), %rsi      # 0xf10c
callq 0x3270
testq %rax, %rax
je 0xd184
movq %rax, %r15
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3250
movq %r15, %rdi
callq 0x3030
movl $0x10000, %r13d         # imm = 0x10000
cmpq %r13, %rax
cmovbq %rax, %r13
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
leaq 0x18c95(%rip), %rdi     # 0x25df0
movq %rdi, (%r12)
movl $0x1, %edx
movq %r13, %rsi
movq %r15, %rcx
callq 0x32e0
movq %r13, (%rbx)
movq %r15, %rdi
callq 0x3220
jmp 0xd18a
movl $0x2, %r14d
jmp 0xd18a
movl $0x3, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: machineInit(unsigned int, unsigned int)
TED *machineInit(unsigned int sampleRate, unsigned int filterOrder)
{
	ted = new TED;
	ted->initFilter(sampleRate, filterOrder);
	cpu = new CPU(ted, ted->Ram + 0xff09, ted->Ram + 0x100);
	ted->cpuptr = cpu;
	ted->loadroms();
	machineReset();
	return ted;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0xb71e0, %edi          # imm = 0xB71E0
callq 0x3230
movq %rax, %r15
movq %rax, %rdi
callq 0x9998
movq %r15, 0x18a83(%rip)     # 0x25de0
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xc30e
movl $0xa8, %edi
callq 0x3230
movq %rax, %rbx
movq 0x18a63(%rip), %rsi     # 0x25de0
leaq 0x55ec9(%rsi), %rdx
leaq 0x460c0(%rsi), %rcx
movq %rax, %rdi
callq 0x41ec
movq %rbx, 0x28a56(%rip)     # 0x35df0
movq 0x18a3f(%rip), %rdi     # 0x25de0
movq %rbx, 0x45fb8(%rdi)
callq 0x9e80
movq 0x18a2c(%rip), %rdi     # 0x25de0
callq 0x9cae
movq 0x28a30(%rip), %rdi     # 0x35df0
callq 0x4416
movq 0x18a14(%rip), %rax     # 0x25de0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0xa8, %esi
movq %rbx, %rdi
jmp 0xd3ef
movq %rax, %r14
movl $0xb71e0, %esi          # imm = 0xB71E0
movq %r15, %rdi
callq 0x3240
movq %r14, %rdi
callq 0x3360
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: machineShutDown()
void machineShutDown()
{
	if(ted) {
		delete ted;
		ted = 0;
	}
	if (cpu) {
		delete cpu;
		cpu = 0;
	}
}

// Assembly:
pushq %rbx
movq 0x18956(%rip), %rdi     # 0x25de0
testq %rdi, %rdi
je 0xd4a0
movq (%rdi), %rax
callq *0x20(%rax)
movq $0x0, 0x18940(%rip) # 0x25de0
movq 0x28949(%rip), %rbx     # 0x35df0
testq %rbx, %rbx
je 0xd4cc
movq %rbx, %rdi
callq 0x8076
movl $0xa8, %esi
movq %rbx, %rdi
callq 0x3240
movq $0x0, 0x28924(%rip) # 0x35df0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayPause()
void tedplayPause()
{
	if (player && playState == 1) {
		player->pause();
		player->lock();
		playState = 2;
	}
}

// Assembly:
movq 0x28923(%rip), %rdi     # 0x35df8
testq %rdi, %rdi
je 0xd505
cmpl $0x1, 0x2891f(%rip)     # 0x35e00
jne 0xd505
pushq %rax
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x28907(%rip), %rdi     # 0x35df8
movq (%rdi), %rax
callq *0x38(%rax)
movl $0x2, 0x288ff(%rip)     # 0x35e00
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayPlay()
void tedplayPlay()
{
	if (player && !(playState == 1)) {
		player->unlock();
		if (!playState)
			ted->oscillatorReset();
		player->play();
		playState = 1;
	}
}

// Assembly:
movq 0x288eb(%rip), %rdi     # 0x35df8
testq %rdi, %rdi
je 0xd552
cmpl $0x1, 0x288e7(%rip)     # 0x35e00
je 0xd552
pushq %rax
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x0, 0x288d7(%rip)     # 0x35e00
jne 0xd537
movq 0x188ae(%rip), %rdi     # 0x25de0
callq 0xbbe0
movq 0x288ba(%rip), %rdi     # 0x35df8
movq (%rdi), %rax
callq *0x10(%rax)
movl $0x1, 0x288b2(%rip)     # 0x35e00
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayStop()
void tedplayStop()
{
	if (player && playState) {
		player->stop();
		player->lock();
	}
	cpu->setPC(playerStartAddress);
	playState = 0;
}

// Assembly:
pushq %rax
movq 0x2889d(%rip), %rdi     # 0x35df8
testq %rdi, %rdi
je 0xd57c
cmpl $0x0, 0x28899(%rip)     # 0x35e00
je 0xd57c
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x28882(%rip), %rdi     # 0x35df8
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x2886d(%rip), %rdi     # 0x35df0
movl $0xfe00, %esi           # imm = 0xFE00
callq 0x44aa
movl $0x0, 0x28869(%rip)     # 0x35e00
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedPlaySetWaveform(unsigned int, unsigned int)
void tedPlaySetWaveform(unsigned int channel, unsigned int wave)
{
	bool wasPlaying = (playState == 1);
	
	if (wasPlaying)
		tedplayPause();
	if (ted) {
		ted->selectWaveForm(channel, wave);
	}
	if (wasPlaying)
		tedplayPlay();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl 0x287dd(%rip), %r14d    # 0x35e00
cmpl $0x1, %r14d
jne 0xd62e
callq 0xd4ce
movq 0x187ab(%rip), %rdi     # 0x25de0
testq %rdi, %rdi
je 0xd643
movl %ebp, %esi
movl %ebx, %edx
callq 0xc2b0
cmpl $0x1, %r14d
jne 0xd652
popq %rbx
popq %r14
popq %rbp
jmp 0xd506
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: tedplayClose()
void tedplayClose()
{
	if (player) {
		player->stop();
		delete player;
		player = 0;
	}
	machineShutDown();
}

// Assembly:
movq 0x2879a(%rip), %rdi     # 0x35df8
testq %rdi, %rdi
je 0xd482
pushq %rax
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x28783(%rip), %rdi     # 0x35df8
testq %rdi, %rdi
je 0xd680
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x2876d(%rip) # 0x35df8
addq $0x8, %rsp
jmp 0xd482
// File: /workspace/github_c_makefile_star2_O1/calmopyrin[P]tedplay/tedplay.cpp
// Function: copyPetsciiToAsc(char*, char*, unsigned int)
static void copyPetsciiToAsc(char* to, char* from, unsigned int size)
{
	if (size) {
		unsigned int i = size - 1;
		do {
			to[i] = convertToAscii((unsigned char)from[i], false);
		} while (i--);
	}
}

// Assembly:
movl $0x1f, %eax
movb (%rsi,%rax), %cl
testb %cl, %cl
je 0xd8fc
cmpb $0x1a, %cl
ja 0xd900
orb $0x60, %cl
jmp 0xd92b
movb $0x20, %cl
jmp 0xd92b
cmpb $0x1f, %cl
ja 0xd90a
orb $0x40, %cl
jmp 0xd92b
leal -0x41(%rcx), %edx
cmpb $0x19, %dl
ja 0xd917
orb $0x20, %cl
jmp 0xd92b
leal 0x3f(%rcx), %edx
movzbl %cl, %r8d
andb $0x5f, %cl
cmpb $0x1a, %dl
movzbl %cl, %ecx
cmovael %r8d, %ecx
movb %cl, (%rdi,%rax)
addq $-0x1, %rax
jb 0xd8eb
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/example/example.c
// Function: report_error
int report_error(void) {
    char message[SIR_MAXERROR] = {0};
    (void)sir_geterror(message);
    (void)fprintf(stderr, SIR_BREDB("libsir error: ") SIR_RED("%s%s"), message, SIR_EOL);
    return EXIT_FAILURE;
}

// Assembly:
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rsp, %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21b0
movq %rbx, %rdi
callq 0x28b8
movq 0xb7e8(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x6c22(%rip), %rdx      # 0x943c
leaq 0x7089(%rip), %r8       # 0x98aa
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x23e0
movl $0x1, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/include/sir/helpers.h
// Function: report_warning
static inline
bool __sir_validstr(const char* restrict str, bool fail, const char* func,
    const char* file, uint32_t line) {
    bool valid = str && *str != '\0';
    if (fail && !valid) {
        SIR_ASSERT(!valid && fail);
        (void)__sir_seterror(_SIR_E_STRING, func, file, line);
    }
    return valid;
}

// Assembly:
testq %rdi, %rdi
je 0x28a3
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0x2899
movq %rsp, %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x21b0
movq %r14, %rdi
callq 0x28b8
movq 0xb782(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x6bf7(%rip), %rdx      # 0x9477
leaq 0x7023(%rip), %r9       # 0x98aa
movl $0x1, %esi
movq %rbx, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x23e0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_debug
bool sir_debug(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_DEBUG, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2928
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2964
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x80, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2983
leaq 0x6b4b(%rip), %rsi      # 0x94b6
leaq 0x6b4e(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x46, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_info
bool sir_info(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_INFO, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x29e6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2a22
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x40, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2a41
leaq 0x6a9d(%rip), %rsi      # 0x94c6
leaq 0x6a90(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x4e, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_notice
bool sir_notice(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_NOTICE, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2aa4
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2ae0
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x20, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2aff
leaq 0x69e8(%rip), %rsi      # 0x94cf
leaq 0x69d2(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x56, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_warn
bool sir_warn(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_WARN, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2b62
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2b9e
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x10, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2bbd
leaq 0x6935(%rip), %rsi      # 0x94da
leaq 0x6914(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x5e, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_error
bool sir_error(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_ERROR, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2c20
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2c5c
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x8, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2c7b
leaq 0x6880(%rip), %rsi      # 0x94e3
leaq 0x6856(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x66, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_crit
bool sir_crit(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_CRIT, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2cde
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2d1a
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x4, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2d39
leaq 0x67cc(%rip), %rsi      # 0x94ed
leaq 0x6798(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x6e, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/aremmell[P]libsir/src/sir.c
// Function: sir_alert
bool sir_alert(PRINTF_FORMAT const char* format, ...) {
    _SIR_L_START(format);
    ret = _sir_logv(SIRL_ALERT, format, args);
    _SIR_L_END();
    return ret;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2d9c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x2dd8
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movl $0x2, %edi
movq %r10, %rsi
callq 0x6979
jmp 0x2df7
leaq 0x6717(%rip), %rsi      # 0x94f6
leaq 0x66da(%rip), %rdx      # 0x94c0
movl $0x800b0000, %edi       # imm = 0x800B0000
movl $0x76, %ecx
callq 0x31c0
xorl %eax, %eax
addq $0xd8, %rsp
retq