LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Sid.cpp
// Function: SIDsound::filterOutput(unsigned int, int)
inline int SIDsound::filterOutput(unsigned int cycles, int Vi)
{
	const int w0deltaTime = w0 >> 6;
	Vi >>= 7;
	unsigned int count = cycles;

	do {
		int dVlp = (w0deltaTime * Vbp >> 14);
		Vlp -= dVlp;
		int dVbp = (w0deltaTime * Vhp >> 14);
		Vbp -= dVbp;
		Vhp = (Vbp * resonanceCoeffDiv1024 >> 10) - Vlp - Vi;
	} while (--count);

	int Vf;

	switch (filterType) {
		default:
		case FILTER_NONE:
			Vf = 0;
			break;
		case FILTER_LP:
			Vf = Vlp;
			break;
		case FILTER_BP:
			Vf = Vbp;
			break;
		case FILTER_LPBP:
			Vf = Vlp + Vbp;
			break;
		case FILTER_HP:
			Vf = Vhp;
			break;
		case FILTER_NOTCH:
			Vf = Vlp + Vhp;
			break;
		case FILTER_HPBP:
			Vf = Vbp + Vhp;
			break;
		case FILTER_ALL:
			Vf = Vlp + Vbp + Vhp;
			break;
	}
	return Vf << 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl 0x41a4(%rax), %eax
sarl $0x6, %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
sarl $0x7, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x41ac(%rax), %ecx
sarl $0xe, %ecx
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movl 0x41b0(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x41b0(%rax)
movl -0x14(%rbp), %ecx
imull 0x41a8(%rax), %ecx
sarl $0xe, %ecx
movl %ecx, -0x20(%rbp)
movl -0x20(%rbp), %edx
movl 0x41ac(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x41ac(%rax)
movl 0x41ac(%rax), %ecx
imull 0x41a0(%rax), %ecx
sarl $0xa, %ecx
subl 0x41b0(%rax), %ecx
subl -0x10(%rbp), %ecx
movl %ecx, 0x41a8(%rax)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jne 0x15651
movq -0x30(%rbp), %rax
movzbl 0x194(%rax), %eax
movq %rax, -0x38(%rbp)
subq $0x7, %rax
ja 0x156ed
movq -0x38(%rbp), %rax
leaq 0x9ecc(%rip), %rcx      # 0x1f5b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x156ef
movl $0x0, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rax
movl 0x41b0(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rax
movl 0x41ac(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rcx
movl 0x41b0(%rcx), %eax
addl 0x41ac(%rcx), %eax
movl %eax, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rax
movl 0x41a8(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rcx
movl 0x41b0(%rcx), %eax
addl 0x41a8(%rcx), %eax
movl %eax, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rcx
movl 0x41ac(%rcx), %eax
addl 0x41a8(%rcx), %eax
movl %eax, -0x24(%rbp)
jmp 0x15780
movq -0x30(%rbp), %rcx
movl 0x41b0(%rcx), %eax
addl 0x41ac(%rcx), %eax
addl 0x41a8(%rcx), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shll $0x7, %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/./Sid.h
// Function: SIDsound::waveTriangle(SIDsound::SIDVoice&)
inline int SIDsound::waveTriangle(SIDVoice &v)
{
	unsigned int msb = (v.ring ? v.accu ^ v.modulatedBy->accu : v.accu)
		& 0x800000;
	// triangle wave 15 bit only
 	return ((msb ? ~v.accu : v.accu) >> 11) & 0xFFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
je 0x157f9
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
xorl 0x20(%rcx), %eax
movl %eax, -0x10(%rbp)
jmp 0x15803
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
andl $0x800000, %eax         # imm = 0x800000
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x15823
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
xorl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1582d
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
shrl $0xb, %eax
andl $0xfff, %eax            # imm = 0xFFF
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Sid.cpp
// Function: SIDsound::waveNoise(SIDsound::SIDVoice&)
inline int SIDsound::waveNoise(SIDVoice &v)
{
	unsigned int shiftReg = v.shiftReg;
	// Pick out bits to make output value, left shift by 4
	return
		(bit(shiftReg,22) << 11) |
		(bit(shiftReg,20) << 10) |
		(bit(shiftReg,16) << 9) |
		(bit(shiftReg,13) << 8) |
		(bit(shiftReg,11) << 7) |
		(bit(shiftReg, 7) << 6) |
		(bit(shiftReg, 4) << 5) |
		(bit(shiftReg, 2) << 4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0x16, %esi
callq 0x15150
shlq $0xb, %rax
movq %rax, -0x48(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0x14, %esi
callq 0x15150
movq %rax, %rcx
movq -0x48(%rbp), %rax
shlq $0xa, %rcx
orq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0x10, %esi
callq 0x15150
movq %rax, %rcx
movq -0x40(%rbp), %rax
shlq $0x9, %rcx
orq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0xd, %esi
callq 0x15150
movq %rax, %rcx
movq -0x38(%rbp), %rax
shlq $0x8, %rcx
orq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0xb, %esi
callq 0x15150
movq %rax, %rcx
movq -0x30(%rbp), %rax
shlq $0x7, %rcx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0x7, %esi
callq 0x15150
movq %rax, %rcx
movq -0x28(%rbp), %rax
shlq $0x6, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
callq 0x15150
movq %rax, %rcx
movq -0x20(%rbp), %rax
shlq $0x5, %rcx
orq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %edi
movl $0x2, %esi
callq 0x15150
movq %rax, %rcx
movq -0x18(%rbp), %rax
shlq $0x4, %rcx
orq %rcx, %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movl -0xc(%rbp), %esi
xorl %edx, %edx
callq 0x14540
movq -0x28(%rbp), %rax
leaq 0xdfbc(%rip), %rcx      # 0x23c78
addq $0x10, %rcx
movq %rcx, (%rax)
testb $0x1, 0x1fbe6(%rip)     # 0x358b0
jne 0x15cd1
callq 0x15ac0
testb $0x1, 0x1fbd8(%rip)     # 0x358b0
je 0x15d0d
movq -0x28(%rbp), %rcx
movq 0x1fbdb(%rip), %rax     # 0x358c0
movl 0x41c0(%rcx), %edx
movl -0xc(%rbp), %esi
movl %edx, %edi
callq *%rax
jmp 0x15cf4
jmp 0x15d0d
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x150f0
jmp 0x15d13
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x3410
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/SIDSoundLib.cpp
// Function: SIDSoundLib::~SIDSoundLib()
SIDSoundLib::~SIDSoundLib()
{
	sidDestroy();
	CLOSE_LIBRARY(m_hDll);
	m_hDll = NULL;
	detected = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xdf4d(%rip), %rcx      # 0x23c88
movq %rcx, (%rax)
movq 0x1fb83(%rip), %rax     # 0x358c8
callq *%rax
jmp 0x15d49
movq 0x1fb68(%rip), %rdi     # 0x358b8
callq 0x31c0
movq -0x10(%rbp), %rdi
movq $0x0, 0x1fb54(%rip) # 0x358b8
movb $0x0, 0x1fb45(%rip)     # 0x358b0
callq 0x150f0
addq $0x10, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x4440
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x41bc(%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x15e41
movq 0x1faaf(%rip), %rax     # 0x358d8
movl -0xc(%rbp), %edi
callq *%rax
callq *0x1faac(%rip)          # 0x358e0
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x41bc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x16322
movq -0x30(%rbp), %rax
movl 0xb71d8(%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x16233
movq -0x30(%rbp), %rax
movq 0xb71d0(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x16222
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0xb71d0(%rax)
jmp 0x16245
movq -0x30(%rbp), %rax
movl 0xb71d8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1637e
cmpl $0x2, -0x14(%rbp)
jne 0x162b0
callq 0x15ac0
testb $0x1, %al
jne 0x16256
jmp 0x162b0
movl $0x41c8, %edi           # imm = 0x41C8
callq 0x3270
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movl $0x1, %esi
callq 0x15c90
jmp 0x16276
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0xb71d0(%rax)
movl $0x2, 0xb71d8(%rax)
jmp 0x1630a
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x41c8, %esi           # imm = 0x41C8
callq 0x3280
jmp 0x16387
movl $0x41c8, %edi           # imm = 0x41C8
callq 0x3270
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movl -0x18(%rbp), %edx
movl $0x1, %esi
callq 0x14540
jmp 0x162d3
movq -0x30(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0xb71d0(%rax)
movl $0x1, 0xb71d8(%rax)
jmp 0x1630a
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x41c8, %esi           # imm = 0x41C8
callq 0x3280
jmp 0x16387
movq -0x30(%rbp), %rax
movq 0xb71d0(%rax), %rdi
movq (%rdi), %rax
movl $0x361f0, %esi          # imm = 0x361F0
callq *0x30(%rax)
jmp 0x16371
movq -0x30(%rbp), %rax
cmpq $0x0, 0xb71d0(%rax)
jne 0x16339
movl $0x0, -0x4(%rbp)
jmp 0x1637e
movq -0x30(%rbp), %rax
movq 0xb71d0(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x16358
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0xb71d0(%rax)
movl $0x0, 0xb71d8(%rax)
movq -0x30(%rbp), %rax
movl 0xb71d8(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3410
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x10000, -0xc(%rbp)    # imm = 0x10000
jge 0x163e6
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %esi
sarl %esi
shll %esi
movl -0xc(%rbp), %edi
movl $0xff, %ecx
xorl %edx, %edx
cmpl %edi, %esi
cmovel %edx, %ecx
movb %cl, %dl
movslq -0xc(%rbp), %rcx
movb %dl, 0x45fc0(%rax,%rcx)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x163ab
movq -0x18(%rbp), %rdi
callq 0x19970
movq -0x18(%rbp), %rax
cmpq $0x0, 0xb71d0(%rax)
je 0x1640e
movq -0x18(%rbp), %rax
movq 0xb71d0(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x1f4f7(%rip), %rcx     # 0x35910
movq %rcx, 0xb61a0(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x164c9
movq -0x18(%rbp), %rax
movq 0xb6010(%rax), %rcx
movl 0x76008(%rax), %edx
andl $0x8000, %edx           # imm = 0x8000
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x75ff0(%rax)
movq 0xb6010(%rax), %rcx
movl 0x76008(%rax), %edx
andl $0xc000, %edx           # imm = 0xC000
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x75ff8(%rax)
movq %rcx, 0x76000(%rax)
jmp 0x164fa
movq -0x18(%rbp), %rax
movq 0x75fe0(%rax), %rcx
movq %rcx, 0x75ff0(%rax)
movq 0x75fe8(%rax), %rcx
movq %rcx, 0x75ff8(%rax)
movq %rax, %rcx
addq $0x55fc0, %rcx          # imm = 0x55FC0
movq %rcx, 0x76000(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x16561
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x1c(%rbp), %eax
shll $0x3, %eax
addl %eax, %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
callq 0x16570
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x16525
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x4, -0xc(%rbp)
jge 0x167db
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movq %rdi, %rdx
addq $0x41b, %rdx            # imm = 0x41B
movslq -0xc(%rbp), %rax
shlq $0x8, %rax
addq %rax, %rdx
callq 0x16820
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movq %rdi, %rdx
addq $0x1b, %rdx
movslq -0xc(%rbp), %rax
shlq $0x8, %rax
addq %rax, %rdx
callq 0x16990
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1678b
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x65fe0, %rcx          # imm = 0x65FE0
movq %rcx, 0x75fe0(%rax)
movq %rcx, 0x75ff0(%rax)
movq %rax, %rcx
addq $0x55fc0, %rcx          # imm = 0x55FC0
movq %rcx, 0x75fe8(%rax)
movq %rcx, 0x75ff8(%rax)
movq %rcx, 0x76000(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x16959
movq -0x18(%rbp), %rdi
leaq 0x78b6(%rip), %rsi      # 0x1e10c
callq 0x32f0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x1689c
movq -0x28(%rbp), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
movslq -0xc(%rbp), %rax
shlq $0xe, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rcx
movl $0x4000, %esi           # imm = 0x4000
movl $0x1, %edx
callq 0x33a0
movq -0x20(%rbp), %rdi
callq 0x3260
jmp 0x1697b
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x168b5
jmp 0x168a8
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x168d6
jmp 0x16935
movq -0x28(%rbp), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
leaq 0x119b9(%rip), %rsi     # 0x28280
movl $0x4000, %edx           # imm = 0x4000
callq 0x31d0
jmp 0x16957
movq -0x18(%rbp), %rdi
leaq 0x8f83(%rip), %rsi      # 0x1f864
movl $0xa, %edx
callq 0x3110
cmpl $0x0, %eax
jne 0x16915
movq -0x28(%rbp), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
addq $0x4000, %rdi           # imm = 0x4000
leaq 0x15977(%rip), %rsi     # 0x2c280
movl $0x4000, %edx           # imm = 0x4000
callq 0x31d0
jmp 0x16933
movq -0x28(%rbp), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
addq $0x4000, %rdi           # imm = 0x4000
xorl %esi, %esi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3130
jmp 0x16957
movq -0x28(%rbp), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
movslq -0xc(%rbp), %rax
shlq $0xe, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3130
jmp 0x1697b
movq -0x28(%rbp), %rdi
addq $0x55fc0, %rdi          # imm = 0x55FC0
movslq -0xc(%rbp), %rax
shlq $0xe, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3130
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x16ac9
movq -0x18(%rbp), %rdi
leaq 0x7746(%rip), %rsi      # 0x1e10c
callq 0x32f0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x16a0c
movq -0x28(%rbp), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
movslq -0xc(%rbp), %rax
shlq $0xe, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rcx
movl $0x4000, %esi           # imm = 0x4000
movl $0x1, %edx
callq 0x33a0
movq -0x20(%rbp), %rdi
callq 0x3260
jmp 0x16aeb
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x16a25
jmp 0x16a18
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x16a46
jmp 0x16aa5
movq -0x28(%rbp), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
leaq 0xd849(%rip), %rsi      # 0x24280
movl $0x4000, %edx           # imm = 0x4000
callq 0x31d0
jmp 0x16ac7
movq -0x18(%rbp), %rdi
leaq 0x8e09(%rip), %rsi      # 0x1f85a
movl $0x9, %edx
callq 0x3110
cmpl $0x0, %eax
jne 0x16a85
movq -0x28(%rbp), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
addq $0x4000, %rdi           # imm = 0x4000
leaq 0x19807(%rip), %rsi     # 0x30280
movl $0x4000, %edx           # imm = 0x4000
callq 0x31d0
jmp 0x16aa3
movq -0x28(%rbp), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
addq $0x4000, %rdi           # imm = 0x4000
xorl %esi, %esi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3130
jmp 0x16ac7
movq -0x28(%rbp), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
movslq -0xc(%rbp), %rax
shlq $0xe, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3130
jmp 0x16aeb
movq -0x28(%rbp), %rdi
addq $0x65fe0, %rdi          # imm = 0x65FE0
movslq -0xc(%rbp), %rax
shlq $0xe, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3130
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x527, -0x18(%rbp)     # imm = 0x527
cmpl $-0x1, -0x14(%rbp)
jne 0x16bb4
movq -0x10(%rbp), %rdi
callq 0x3100
movl %eax, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x16bea
movq -0x28(%rbp), %rdi
movl -0x18(%rbp), %esi
addl -0x1c(%rbp), %esi
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movb (%rax,%rcx), %cl
movq (%rdi), %rax
movzbl %cl, %edx
callq *(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x16bbb
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %eax
movb %al, %cl
movq (%rdi), %rax
movl $0xef, %esi
movzbl %cl, %edx
callq *(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::~TED()
TED::~TED()
{
	if (filter)
		delete filter;

	if (sidCard)
		enableSidCard(0, 0);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xa55d(%rip), %rcx      # 0x23cf8
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x65fd8(%rax)
je 0x197cd
movq -0x10(%rbp), %rax
movq 0x65fd8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x197cb
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x197cd
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb71d0(%rax)
je 0x197ec
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x161d0
jmp 0x197ea
jmp 0x197ec
addq $0x20, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x4440
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::DoDMA(unsigned char*, unsigned int)
inline void TED::DoDMA( unsigned char *Buf, unsigned int Offset )
{
	if ( CharacterCount>=0x03D8 ) {
		memcpy( Buf, VideoBase + CharacterCount + Offset, 0x400 - CharacterCount);
		memcpy( Buf + 0x400 - CharacterCount, VideoBase + Offset, (CharacterCount + 40)&0x03FF);
	} else {
		memcpy( Buf, VideoBase + CharacterCount + Offset, 40);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x3d8, 0x1c0bf(%rip)   # imm = 0x3D8
jb 0x198fe
movq -0x10(%rbp), %rdi
movq 0x1c08e(%rip), %rsi     # 0x35928
movl 0x1c0ac(%rip), %eax     # 0x3594c
addq %rax, %rsi
movl -0x14(%rbp), %eax
addq %rax, %rsi
movl $0x400, %eax            # imm = 0x400
subl 0x1c098(%rip), %eax     # 0x3594c
movl %eax, %eax
movl %eax, %edx
callq 0x31d0
movq -0x10(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movl 0x1c07e(%rip), %eax     # 0x3594c
movl %eax, %ecx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rdi
movq 0x1c049(%rip), %rsi     # 0x35928
movl -0x14(%rbp), %eax
addq %rax, %rsi
movl 0x1c061(%rip), %eax     # 0x3594c
addl $0x28, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, %eax
movl %eax, %edx
callq 0x31d0
jmp 0x19922
movq -0x10(%rbp), %rdi
movq 0x1c01f(%rip), %rsi     # 0x35928
movl 0x1c03d(%rip), %eax     # 0x3594c
addq %rax, %rsi
movl -0x14(%rbp), %eax
addq %rax, %rsi
movl $0x28, %edx
callq 0x31d0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, 0x1c002(%rip)     # 0x35984
movl $0x0, 0x1c000(%rip)     # 0x3598c
movl $0x0, 0x1bff2(%rip)     # 0x35988
movl $0x0, 0x1bff0(%rip)     # 0x35990
movl $0x0, 0x1bfea(%rip)     # 0x35994
movl $0x0, 0x1bfe4(%rip)     # 0x35998
movl $0x0, 0x1bfde(%rip)     # 0x3599c
movw $0x0, 0x1bfd9(%rip)     # 0x359a0
movw $0x0, 0x1bfd2(%rip)     # 0x359a2
movl $0x0, 0x1bfca(%rip)     # 0x359a4
movl $0x0, 0x1bfc4(%rip)     # 0x359a8
movl $0x0, 0x1bfbe(%rip)     # 0x359ac
movl $0x0, 0x1bfb8(%rip)     # 0x359b0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movabsq $0x3f947ae147ae147b, %rcx # imm = 0x3F947AE147AE147B
movq %rcx, -0x20(%rbp)
movl 0xb71c8(%rax), %eax
cvtsi2sd %rax, %xmm0
movsd 0x5a3c(%rip), %xmm1     # 0x1f888
mulsd %xmm0, %xmm1
movsd 0x5420(%rip), %xmm0     # 0x1f278
mulsd %xmm0, %xmm1
movsd 0x41bc(%rip), %xmm0     # 0x1e020
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x38(%rbp), %rax
movq 0x65fd8(%rax), %rdi
movq -0x10(%rbp), %rax
movswl (%rax), %esi
callq 0x13f90
cwtl
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x1bd3d(%rip), %xmm1    # 0x35bd8
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm2
movsd 0x1bd22(%rip), %xmm1    # 0x35bd8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1bd12(%rip)    # 0x35bd8
movsd -0x30(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x10(%rbp)
movw %cx, (%rax)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jne 0x19e6d
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, 0x65fd8(%rax)
je 0x1a3a5
movq -0x28(%rbp), %rax
movq 0x65fd8(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x1a3a3
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x1a3a5
movl $0x50, %edi
callq 0x3270
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %esi
shrl %esi
movl -0x10(%rbp), %ecx
movl $0x361f0, %edx          # imm = 0x361F0
callq 0x136b0
jmp 0x1a3cd
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x65fd8(%rax)
movq 0x65fd8(%rax), %rdi
callq 0x13760
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, 0xb71cc(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0xb71c8(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x50, %esi
callq 0x3280
movq -0x18(%rbp), %rdi
callq 0x3410
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::getWaveSample(unsigned int, unsigned int)
inline unsigned int TED::getWaveSample(unsigned int channel, unsigned int wave)
{
	unsigned int sm;

	switch (wave) {
		default:
		case 1: // square
			return waveSquare(channel);
		case 2: // sawtooth
			return waveSawTooth(channel);
		case 4: // triangle
			return waveTriangle(channel);

		// combined waveforms � la SID
		case 3: // square + sawtooth
			sm = waveSawTooth(channel) + waveSquare(channel);
			return sm /= 2;
		case 5: // square + triangle
			sm = waveTriangle(channel) + waveSquare(channel);
			return sm /= 2;
		case 6: // sawtooth + triangle
			sm = waveTriangle(channel) + waveSawTooth(channel);
			return sm /= 2;
		case 7: // square + sawtooth + triangle
			sm = waveTriangle(channel) + waveSawTooth(channel) + waveSquare(channel);
			return sm /= 3;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x6, %eax
ja 0x1a51e
movq -0x28(%rbp), %rax
leaq 0x53bf(%rip), %rcx      # 0x1f8d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x1a520
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a650
movl %eax, -0x4(%rbp)
jmp 0x1a642
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a670
movl %eax, -0x4(%rbp)
jmp 0x1a642
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a6e0
movl %eax, -0x4(%rbp)
jmp 0x1a642
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a670
movq -0x30(%rbp), %rdi
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %esi
callq 0x1a650
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
shrl %eax
movl %eax, -0x1c(%rbp)
movl %eax, -0x4(%rbp)
jmp 0x1a642
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a6e0
movq -0x30(%rbp), %rdi
movl %eax, -0x38(%rbp)
movl -0x14(%rbp), %esi
callq 0x1a650
movl %eax, %ecx
movl -0x38(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
shrl %eax
movl %eax, -0x1c(%rbp)
movl %eax, -0x4(%rbp)
jmp 0x1a642
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a6e0
movq -0x30(%rbp), %rdi
movl %eax, -0x3c(%rbp)
movl -0x14(%rbp), %esi
callq 0x1a670
movl %eax, %ecx
movl -0x3c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
shrl %eax
movl %eax, -0x1c(%rbp)
movl %eax, -0x4(%rbp)
jmp 0x1a642
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1a6e0
movq -0x30(%rbp), %rdi
movl %eax, -0x44(%rbp)
movl -0x14(%rbp), %esi
callq 0x1a670
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x14(%rbp), %esi
callq 0x1a650
movl %eax, %ecx
movl -0x40(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x1c(%rbp)
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::waveSawTooth(unsigned int)
inline unsigned int TED::waveSawTooth(unsigned int channel)
{
	unsigned int mod;

#if 0
	int msb = OSCRELOADVAL + 1 - OscReload[channel];
	int diff = 2 * msb - int(FlipFlop[channel]) * msb - int(oscCount[channel]) + int(OscReload[channel]);
	//if (diff < 0) diff = 0;
	//if (oscCount[channel] >= 0x3fa) diff = 0;
	mod = (Volume * diff) / (2 * msb);
#else
	int diff = int(oscCount[channel]) - int(OscReload[channel]);
	if (diff < 0) diff = 0;
	mod = (Volume * diff) / (OSCRELOADVAL + 1 - OscReload[channel]);
#endif
	return mod;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x1b30d(%rip), %rax     # 0x35994
movl (%rax,%rcx,4), %eax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
leaq 0x1b52e(%rip), %rcx     # 0x35bc4
subl (%rcx,%rdx,4), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x1a6a9
movl $0x0, -0x14(%rbp)
movl 0x1b51d(%rip), %eax     # 0x35bcc
imull -0x14(%rbp), %eax
movl -0xc(%rbp), %ecx
movl %ecx, %esi
movl $0x401, %ecx            # imm = 0x401
leaq 0x1b500(%rip), %rdx     # 0x35bc4
subl (%rdx,%rsi,4), %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/Tedsound.cpp
// Function: TED::waveTriangle(unsigned int)
inline unsigned int TED::waveTriangle(unsigned int channel)
{
	unsigned int mod;
	int msb;

#if 0
	msb = OSCRELOADVAL + 1 - OscReload[channel];
	int diff = FlipFlop[channel] ? int(oscCount[channel]) - int(OscReload[channel]) 
		: int(OSCRELOADVAL) - int(oscCount[channel]);
	//if (diff < 0) diff = 0;
	//if (oscCount[channel] >= 0x3fa) diff = 0;
	mod = (3 * Volume * diff / msb / 2);
#else
	/*
		msb = (OscReload[channel] + OSCRELOADVAL) / 2;
	int diff = oscCount[channel] < msb ? oscCount[channel] - OscReload[channel] : OSCRELOADVAL - oscCount[channel];
	mod = (2 * diff * Volume / (OSCRELOADVAL - OscReload[channel] + 1));
	if (mod > Volume) mod = Volume;
	*/
	msb = (OscReload[channel] + OSCRELOADVAL) / 2;
	mod = oscCount[channel] < msb ? oscCount[channel] : (oscCount[channel] - msb);
	mod = (mod * Volume / msb);
#endif
	return mod;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x1b4cd(%rip), %rax     # 0x35bc4
movl (%rax,%rcx,4), %eax
addl $0x400, %eax            # imm = 0x400
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x1b27e(%rip), %rax     # 0x35994
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jge 0x1a732
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x1b26a(%rip), %rax     # 0x35994
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
jmp 0x1a747
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x1b256(%rip), %rax     # 0x35994
movl (%rax,%rcx,4), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
imull 0x1b475(%rip), %eax     # 0x35bcc
xorl %edx, %edx
divl -0x14(%rbp)
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    if (argc < 2) {
        printUsage();
        return -1;
    }
	unsigned int defaultFreq = 48000;
	int retval = tedplayMain(argv[1],
		player = new AudioSDL((void *) machineInit(defaultFreq, 24), defaultFreq, 100));
	if (0 == retval) {
		printPsidInfo(getPsidHeader());
		loop();
		tedplayClose();
	}
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x1a79d
callq 0x1a860
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1a841
movl $0xbb80, -0x14(%rbp)    # imm = 0xBB80
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x18, %edi
callq 0x3270
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %edi
movl $0x18, %esi
callq 0x1bab0
movq %rax, -0x30(%rbp)
jmp 0x1a7d1
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %edx
movl $0x64, %ecx
callq 0x3e40
jmp 0x1a7e8
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdi
movq %rsi, 0x1b3f9(%rip)     # 0x35bf0
callq 0x1c380
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl -0x18(%rbp), %eax
jne 0x1a83b
callq 0x1ad30
movq %rax, %rdi
callq 0x1b530
callq 0x1a8f0
callq 0x1bf80
jmp 0x1a83b
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x3280
jmp 0x1a84a
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3410
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/main.cpp
// Function: printUsage()
static void printUsage()
{
    cout << "tedplay - a (mostly) Commodore 264 family media player" << endl;
    cout << "Copyright 2012,2015,2023 Attila Grosz" << endl;
    cout << "Usage:" << endl;
    cout << "tedplay filename" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x975d(%rip), %rdi      # 0x23fc8
leaq 0x51be(%rip), %rsi      # 0x1fa30
callq 0x3250
movq %rax, %rdi
movq 0x9737(%rip), %rsi      # 0x23fb8
callq 0x3290
movq 0x973b(%rip), %rdi      # 0x23fc8
leaq 0x51d3(%rip), %rsi      # 0x1fa67
callq 0x3250
movq %rax, %rdi
movq 0x9715(%rip), %rsi      # 0x23fb8
callq 0x3290
movq 0x9719(%rip), %rdi      # 0x23fc8
leaq 0x51d7(%rip), %rsi      # 0x1fa8d
callq 0x3250
movq %rax, %rdi
movq 0x96f3(%rip), %rsi      # 0x23fb8
callq 0x3290
movq 0x96f7(%rip), %rdi      # 0x23fc8
leaq 0x51bc(%rip), %rsi      # 0x1fa94
callq 0x3250
movq %rax, %rdi
movq 0x96d1(%rip), %rsi      # 0x23fb8
callq 0x3290
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq 0x1b54d(%rip), %rdi     # 0x362a0
movq (%rdi), %rax
movl $0xff13, %esi           # imm = 0xFF13
callq *0x8(%rax)
movzbl %al, %eax
andl $0x4, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x9(%rbp)
movq 0x1b528(%rip), %rdi     # 0x362a0
movq (%rdi), %rax
movl $0xff14, %esi           # imm = 0xFF14
callq *0x8(%rax)
movzbl %al, %eax
andl $0xf8, %eax
shll $0x8, %eax
movl %eax, -0x10(%rbp)
movq 0x1b508(%rip), %rax     # 0x362a0
addq $0x45fc0, %rax          # imm = 0x45FC0
movl -0x10(%rbp), %ecx
orl $0x400, %ecx            # imm = 0x400
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x19, -0x1c(%rbp)
jae 0x1ae3c
movl $0x0, -0x20(%rbp)
cmpl $0x28, -0x20(%rbp)
jae 0x1ae0a
movq -0x18(%rbp), %rax
movb (%rax), %cl
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %cl, %edi
movzbl %al, %esi
callq 0x1ae60
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1adc4
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb $0xd, (%rax)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb $0xa, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1adb7
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movb %dil, %cl
movb %cl, -0x1(%rbp)
andb $0x1, %al
movb %al, -0x2(%rbp)
movb $0x20, -0x3(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0x0, %eax
jne 0x1ae88
movb $0x20, -0x3(%rbp)
jmp 0x1af6d
testb $0x1, -0x2(%rbp)
je 0x1aece
movzbl -0x1(%rbp), %eax
cmpl $0x1f, %eax
jg 0x1aea3
movzbl -0x1(%rbp), %eax
xorl $0x40, %eax
movb %al, -0x3(%rbp)
jmp 0x1aec9
movzbl -0x1(%rbp), %eax
cmpl $0x60, %eax
jl 0x1aec1
movzbl -0x1(%rbp), %eax
cmpl $0x7f, %eax
jg 0x1aec1
movzbl -0x1(%rbp), %eax
subl $0x20, %eax
movb %al, -0x3(%rbp)
jmp 0x1aec7
movb -0x1(%rbp), %al
movb %al, -0x3(%rbp)
jmp 0x1aec9
jmp 0x1af6b
movzbl -0x1(%rbp), %eax
cmpl $0x1, %eax
jl 0x1aeec
movzbl -0x1(%rbp), %eax
cmpl $0x1a, %eax
jg 0x1aeec
movzbl -0x1(%rbp), %eax
xorl $0x60, %eax
movb %al, -0x3(%rbp)
jmp 0x1af69
movzbl -0x1(%rbp), %eax
cmpl $0x1b, %eax
jl 0x1af0a
movzbl -0x1(%rbp), %eax
cmpl $0x1f, %eax
jg 0x1af0a
movzbl -0x1(%rbp), %eax
xorl $0x40, %eax
movb %al, -0x3(%rbp)
jmp 0x1af67
movzbl -0x1(%rbp), %eax
cmpl $0x0, %eax
jne 0x1af19
movb $0x40, -0x3(%rbp)
jmp 0x1af65
movzbl -0x1(%rbp), %eax
cmpl $0x41, %eax
jl 0x1af37
movzbl -0x1(%rbp), %eax
cmpl $0x5a, %eax
jg 0x1af37
movzbl -0x1(%rbp), %eax
xorl $0x20, %eax
movb %al, -0x3(%rbp)
jmp 0x1af63
movzbl -0x1(%rbp), %eax
cmpl $0xc1, %eax
jl 0x1af5b
movzbl -0x1(%rbp), %eax
cmpl $0xda, %eax
jg 0x1af5b
movzbl -0x1(%rbp), %eax
xorl $0x80, %eax
movb %al, -0x3(%rbp)
jmp 0x1af61
movb -0x1(%rbp), %al
movb %al, -0x3(%rbp)
jmp 0x1af63
jmp 0x1af65
jmp 0x1af67
jmp 0x1af69
jmp 0x1af6b
jmp 0x1af6d
movb -0x3(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3100
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
cmpq -0x18(%rbp), %rax
jae 0x1afae
movl -0xc(%rbp), %eax
movq %rax, -0x30(%rbp)
jmp 0x1afb6
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x8(%rbp), %rcx
movb %al, -0x31(%rbp)
jbe 0x1aff2
movq -0x28(%rbp), %rax
movsbl (%rax), %edi
callq 0x3050
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x1affb
jmp 0x1b009
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1afce
movq -0x28(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1b108
movq -0x10(%rbp), %rdi
addq $0x34, %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x3130
movq -0x10(%rbp), %rax
addq $0x34, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
addq $0x16, %rdi
movl $0x20, %esi
callq 0x1af80
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movl $0x20, %edx
callq 0x3120
movq -0x10(%rbp), %rax
movb $0x0, 0x6a(%rax)
movq -0x10(%rbp), %rax
addq $0x234, %rax            # imm = 0x234
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0x36, %rdi
movl $0x20, %esi
callq 0x1af80
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movl $0x20, %edx
callq 0x3120
movq -0x10(%rbp), %rax
movb $0x0, 0x28a(%rax)
movq -0x10(%rbp), %rax
addq $0x434, %rax            # imm = 0x434
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
addq $0x56, %rdi
movl $0x20, %esi
callq 0x1af80
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movl $0x20, %edx
callq 0x3120
movq -0x10(%rbp), %rax
movb $0x0, 0x4aa(%rax)
jmp 0x1b161
movq -0x10(%rbp), %rdi
addq $0x34, %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x3130
movq -0x10(%rbp), %rdi
addq $0x234, %rdi            # imm = 0x234
xorl %esi, %esi
movl $0x20, %edx
callq 0x3130
movq -0x10(%rbp), %rdi
addq $0x434, %rdi            # imm = 0x434
xorl %esi, %esi
movl $0x20, %edx
callq 0x3130
movq -0x10(%rbp), %rdi
addq $0x434, %rdi            # imm = 0x434
xorl %esi, %esi
movl $0x20, %edx
callq 0x3130
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)