// File: /workspace/github_c_makefile_star2_O0/calmopyrin[P]tedplay/SIDSoundLib.cpp
// Function: SIDSoundLib::connect()
bool SIDSoundLib::connect()
{
	if (!detected) {
#ifdef _DEBUG
		m_hDll = LOAD_LIBRARY(LIBNAME_DEBUG);
#else
		m_hDll = LOAD_LIBRARY(LIBNAME);
#endif
		//HRESULT r = GetLastError();
		if (m_hDll) {
			sidCreate = (_sidCreate)LOAD_FUNCTION(m_hDll, "sidCreate");
			sidDestroy = (_sidDestroy)LOAD_FUNCTION(m_hDll, "sidDestroy");
			sidSetSampleRate = (_sidSetSampleRate)LOAD_FUNCTION(m_hDll, "sidSetSampleRate");
			sidSetModel = (_sidSetSampleRate)LOAD_FUNCTION(m_hDll, "sidSetModel");
			sidReset = (_sidReset)LOAD_FUNCTION(m_hDll, "sidReset");
			sidPause = (_sidPause)LOAD_FUNCTION(m_hDll, "sidPause");
			sidWriteReg = (_sidWriteReg)LOAD_FUNCTION(m_hDll, "sidWriteReg");
			sidReadReg = (_sidReadReg)LOAD_FUNCTION(m_hDll, "sidReadReg");
			sidCalcSamples = (_sidCalcSamples)LOAD_FUNCTION(m_hDll, "sidCalcSamples");
			sidGetLibVersion = (_sidGetLibVersion)LOAD_FUNCTION(m_hDll, "sidGetLibVersion");
			if (!(sidCreate && sidDestroy && sidSetSampleRate && sidSetModel && sidReset && sidPause
				&& sidWriteReg && sidReadReg && sidCalcSamples && sidGetLibVersion))
				return false;
		} else
			return false;
	}
	detected = true;
	return detected;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
testb $0x1, 0x1fde1(%rip)     # 0x358b0
jne 0x15c70
leaq 0x9af9(%rip), %rdi      # 0x1f5d5
xorl %esi, %esi
callq 0x3360
movq %rax, 0x1fdce(%rip)     # 0x358b8
cmpq $0x0, 0x1fdc6(%rip)     # 0x358b8
je 0x15c68
movq 0x1fdb9(%rip), %rdi     # 0x358b8
leaq 0x9ad6(%rip), %rsi      # 0x1f5dc
callq 0x3240
movq %rax, 0x1fdae(%rip)     # 0x358c0
movq 0x1fd9f(%rip), %rdi     # 0x358b8
leaq 0x9ac6(%rip), %rsi      # 0x1f5e6
callq 0x3240
movq %rax, 0x1fd9c(%rip)     # 0x358c8
movq 0x1fd85(%rip), %rdi     # 0x358b8
leaq 0x9ab7(%rip), %rsi      # 0x1f5f1
callq 0x3240
movq %rax, 0x1fd8a(%rip)     # 0x358d0
movq 0x1fd6b(%rip), %rdi     # 0x358b8
leaq 0x9aae(%rip), %rsi      # 0x1f602
callq 0x3240
movq %rax, 0x1fd78(%rip)     # 0x358d8
movq 0x1fd51(%rip), %rdi     # 0x358b8
leaq 0x9aa0(%rip), %rsi      # 0x1f60e
callq 0x3240
movq %rax, 0x1fd66(%rip)     # 0x358e0
movq 0x1fd37(%rip), %rdi     # 0x358b8
leaq 0x9a8f(%rip), %rsi      # 0x1f617
callq 0x3240
movq %rax, 0x1fd54(%rip)     # 0x358e8
movq 0x1fd1d(%rip), %rdi     # 0x358b8
leaq 0x9a7e(%rip), %rsi      # 0x1f620
callq 0x3240
movq %rax, 0x1fd42(%rip)     # 0x358f0
movq 0x1fd03(%rip), %rdi     # 0x358b8
leaq 0x9a70(%rip), %rsi      # 0x1f62c
callq 0x3240
movq %rax, 0x1fd30(%rip)     # 0x358f8
movq 0x1fce9(%rip), %rdi     # 0x358b8
leaq 0x9a61(%rip), %rsi      # 0x1f637
callq 0x3240
movq %rax, 0x1fd1e(%rip)     # 0x35900
movq 0x1fccf(%rip), %rdi     # 0x358b8
leaq 0x9a56(%rip), %rsi      # 0x1f646
callq 0x3240
movq %rax, 0x1fd0c(%rip)     # 0x35908
cmpq $0x0, 0x1fcbc(%rip)     # 0x358c0
je 0x15c60
cmpq $0x0, 0x1fcba(%rip)     # 0x358c8
je 0x15c60
cmpq $0x0, 0x1fcb8(%rip)     # 0x358d0
je 0x15c60
cmpq $0x0, 0x1fcb6(%rip)     # 0x358d8
je 0x15c60
cmpq $0x0, 0x1fcb4(%rip)     # 0x358e0
je 0x15c60
cmpq $0x0, 0x1fcb2(%rip)     # 0x358e8
je 0x15c60
cmpq $0x0, 0x1fcb0(%rip)     # 0x358f0
je 0x15c60
cmpq $0x0, 0x1fcae(%rip)     # 0x358f8
je 0x15c60
cmpq $0x0, 0x1fcac(%rip)     # 0x35900
je 0x15c60
cmpq $0x0, 0x1fcaa(%rip)     # 0x35908
jne 0x15c66
movb $0x0, -0x1(%rbp)
jmp 0x15c82
jmp 0x15c6e
movb $0x0, -0x1(%rbp)
jmp 0x15c82
jmp 0x15c70
movb $0x1, 0x1fc39(%rip)     # 0x358b0
movb 0x1fc33(%rip), %al      # 0x358b0
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)