// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/pcsx.c
// Function: PCSX_Init
void PCSX_Init(void)
{
	PCSX_library = SDL_LoadObject("psx.dll");
	if (!PCSX_library)
		SDL_LogError(LOG_PCSX,"Failed to load PCSX library");
	METHOD(PCSX_InitLibrary,"pcsxInit",void(*)(const char *,uint32_t **,struct pcsxinitinfo *));
	METHOD(PCSX_Read8,"pcsxReadMemory8",uint8_t(*)(uint32_t));
	METHOD(PCSX_Read16,"pcsxReadMemory16",uint16_t(*)(uint32_t));
	METHOD(PCSX_Read32,"pcsxReadMemory32",uint32_t(*)(uint32_t));
	METHOD(PCSX_Write8,"pcsxWriteMemory8",void(*)(uint32_t,uint8_t));
	METHOD(PCSX_Write16,"pcsxWriteMemory16",void(*)(uint32_t,uint16_t));
	METHOD(PCSX_Write32,"pcsxWriteMemory32",void(*)(uint32_t,uint32_t));
	METHOD(PCSX_ReadCOPData,"pcsxReadCOPData",uint32_t(*)(int,int));
	METHOD(PCSX_WriteCOPData,"pcsxWriteCOPData",void(*)(int,int,uint32_t));
	METHOD(PCSX_ReadCOPControl,"pcsxReadCOPControl",uint32_t(*)(int,int));
	METHOD(PCSX_WriteCOPControl,"pcsxWriteCOPControl",void(*)(int,int,uint32_t));
	METHOD(PCSX_ExecuteCOP,"pcsxExecuteCOP",void(*)(int,uint32_t));
	METHOD(PCSX_Syscall,"pcsxSyscall",void(*)(uint32_t));
	METHOD(PCSX_Cycle,"pcsxCycle",void(*)(int));
	METHOD(PCSX_RunInterrupts,"pcsxRunInterrupts",uint32_t(*)(uint32_t));
	METHOD(PCSX_Disassemble,"pcsxDisassemble",const char *(*)(uint32_t));
	METHOD(PCSX_A0Name,"pcsxA0Name",const char *(*)(int));
	METHOD(PCSX_B0Name,"pcsxB0Name",const char *(*)(int));
	METHOD(PCSX_C0Name,"pcsxC0Name",const char *(*)(int));
	METHOD(PCSX_HLEA0,"pcsxHLEA0",uint32_t(*)(void));
	METHOD(PCSX_HLEB0,"pcsxHLEB0",uint32_t(*)(void));
	METHOD(PCSX_HLEC0,"pcsxHLEC0",uint32_t(*)(void));
	info.invoke = EMU_Invoke;
	info.saveregisters = EMU_SaveRegisters;
	info.deliverevent = BIOS_DeliverEvent;
	info.ram = &EMU_ram;
	info.scratch = &EMU_scratch;
	PCSX_InitLibrary("c2c.bin",&EMU_reg,&info);
}

// Assembly:
pushq %rax
leaq 0x3ab3(%rip), %rdi      # 0x165383
callq 0x1050
movq %rax, 0x9994(%rip)      # 0x16b270
testq %rax, %rax
jne 0x1618f4
leaq 0x3aa3(%rip), %rsi      # 0x16538b
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9975(%rip), %rdi      # 0x16b270
leaq 0x3aa5(%rip), %rsi      # 0x1653a7
callq 0x10c0
movq %rax, 0x996a(%rip)      # 0x16b278
testq %rax, %rax
jne 0x161926
leaq 0x3a96(%rip), %rsi      # 0x1653b0
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9943(%rip), %rdi      # 0x16b270
leaq 0x3aa3(%rip), %rsi      # 0x1653d7
callq 0x10c0
movq %rax, 0x9940(%rip)      # 0x16b280
testq %rax, %rax
jne 0x161958
leaq 0x3a9b(%rip), %rsi      # 0x1653e7
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9911(%rip), %rdi      # 0x16b270
leaq 0x3aa2(%rip), %rsi      # 0x165408
callq 0x10c0
movq %rax, 0x9916(%rip)      # 0x16b288
testq %rax, %rax
jne 0x16198a
leaq 0x3a9b(%rip), %rsi      # 0x165419
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x98df(%rip), %rdi      # 0x16b270
leaq 0x3aa3(%rip), %rsi      # 0x16543b
callq 0x10c0
movq %rax, 0x98ec(%rip)      # 0x16b290
testq %rax, %rax
jne 0x1619bc
leaq 0x3a9c(%rip), %rsi      # 0x16544c
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x98ad(%rip), %rdi      # 0x16b270
leaq 0x3aa4(%rip), %rsi      # 0x16546e
callq 0x10c0
movq %rax, 0x98c2(%rip)      # 0x16b298
testq %rax, %rax
jne 0x1619ee
leaq 0x3a9d(%rip), %rsi      # 0x16547f
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x987b(%rip), %rdi      # 0x16b270
leaq 0x3aa5(%rip), %rsi      # 0x1654a1
callq 0x10c0
movq %rax, 0x9898(%rip)      # 0x16b2a0
testq %rax, %rax
jne 0x161a20
leaq 0x3a9f(%rip), %rsi      # 0x1654b3
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9849(%rip), %rdi      # 0x16b270
leaq 0x3aa8(%rip), %rsi      # 0x1654d6
callq 0x10c0
movq %rax, 0x986e(%rip)      # 0x16b2a8
testq %rax, %rax
jne 0x161a52
leaq 0x3aa2(%rip), %rsi      # 0x1654e8
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9817(%rip), %rdi      # 0x16b270
leaq 0x3aab(%rip), %rsi      # 0x16550b
callq 0x10c0
movq %rax, 0x9844(%rip)      # 0x16b2b0
testq %rax, %rax
jne 0x161a84
leaq 0x3aa3(%rip), %rsi      # 0x16551b
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x97e5(%rip), %rdi      # 0x16b270
leaq 0x3ab0(%rip), %rsi      # 0x165542
callq 0x10c0
movq %rax, 0x981a(%rip)      # 0x16b2b8
testq %rax, %rax
jne 0x161ab6
leaq 0x3aa9(%rip), %rsi      # 0x165553
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x97b3(%rip), %rdi      # 0x16b270
leaq 0x3ab7(%rip), %rsi      # 0x16557b
callq 0x10c0
movq %rax, 0x97f0(%rip)      # 0x16b2c0
testq %rax, %rax
jne 0x161ae8
leaq 0x3ab2(%rip), %rsi      # 0x16558e
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9781(%rip), %rdi      # 0x16b270
leaq 0x3ac2(%rip), %rsi      # 0x1655b8
callq 0x10c0
movq %rax, 0x97c6(%rip)      # 0x16b2c8
testq %rax, %rax
jne 0x161b1a
leaq 0x3abe(%rip), %rsi      # 0x1655cc
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x974f(%rip), %rdi      # 0x16b270
leaq 0x3acf(%rip), %rsi      # 0x1655f7
callq 0x10c0
movq %rax, 0x979c(%rip)      # 0x16b2d0
testq %rax, %rax
jne 0x161b4c
leaq 0x3ac6(%rip), %rsi      # 0x165606
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x971d(%rip), %rdi      # 0x16b270
leaq 0x3ad2(%rip), %rsi      # 0x16562c
callq 0x10c0
movq %rax, 0x9772(%rip)      # 0x16b2d8
testq %rax, %rax
jne 0x161b7e
leaq 0x3ac6(%rip), %rsi      # 0x165638
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x96eb(%rip), %rdi      # 0x16b270
leaq 0x3acf(%rip), %rsi      # 0x16565b
callq 0x10c0
movq %rax, 0x9748(%rip)      # 0x16b2e0
testq %rax, %rax
jne 0x161bb0
leaq 0x3ac1(%rip), %rsi      # 0x165665
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x96b9(%rip), %rdi      # 0x16b270
leaq 0x3ac8(%rip), %rsi      # 0x165686
callq 0x10c0
movq %rax, 0x971e(%rip)      # 0x16b2e8
testq %rax, %rax
jne 0x161be2
leaq 0x3ac2(%rip), %rsi      # 0x165698
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9687(%rip), %rdi      # 0x16b270
leaq 0x3ad1(%rip), %rsi      # 0x1656c1
callq 0x10c0
movq %rax, 0x96f4(%rip)      # 0x16b2f0
testq %rax, %rax
jne 0x161c14
leaq 0x3ac9(%rip), %rsi      # 0x1656d1
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9655(%rip), %rdi      # 0x16b270
leaq 0x3ad6(%rip), %rsi      # 0x1656f8
callq 0x10c0
movq %rax, 0x96ca(%rip)      # 0x16b2f8
testq %rax, %rax
jne 0x161c46
leaq 0x3ac9(%rip), %rsi      # 0x165703
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9623(%rip), %rdi      # 0x16b270
leaq 0x3ad1(%rip), %rsi      # 0x165725
callq 0x10c0
movq %rax, 0x96a0(%rip)      # 0x16b300
testq %rax, %rax
jne 0x161c78
leaq 0x3ac4(%rip), %rsi      # 0x165730
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x95f1(%rip), %rdi      # 0x16b270
leaq 0x3acc(%rip), %rsi      # 0x165752
callq 0x10c0
movq %rax, 0x9676(%rip)      # 0x16b308
testq %rax, %rax
jne 0x161caa
leaq 0x3abf(%rip), %rsi      # 0x16575d
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x95bf(%rip), %rdi      # 0x16b270
leaq 0x3ac7(%rip), %rsi      # 0x16577f
callq 0x10c0
movq %rax, 0x964c(%rip)      # 0x16b310
testq %rax, %rax
jne 0x161cdc
leaq 0x3ab9(%rip), %rsi      # 0x165789
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x958d(%rip), %rdi      # 0x16b270
leaq 0x3ac0(%rip), %rsi      # 0x1657aa
callq 0x10c0
movq %rax, 0x9622(%rip)      # 0x16b318
testq %rax, %rax
jne 0x161d0e
leaq 0x3ab2(%rip), %rsi      # 0x1657b4
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x955b(%rip), %rdi      # 0x16b270
leaq 0x3ab9(%rip), %rsi      # 0x1657d5
callq 0x10c0
movq %rax, 0x95f8(%rip)      # 0x16b320
testq %rax, %rax
jne 0x161d40
leaq 0x3aab(%rip), %rsi      # 0x1657df
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
leaq 0xf98(%rip), %rax       # 0x162cdf
movq %rax, 0x95da(%rip)      # 0x16b328
leaq 0x95d3(%rip), %rdx      # 0x16b328
leaq 0x12ea(%rip), %rax      # 0x163046
movq %rax, 0x95cd(%rip)      # 0x16b330
leaq -0x990(%rip), %rax      # 0x1613da
movq %rax, 0x95c7(%rip)      # 0x16b338
leaq 0x4095e8(%rip), %rax    # 0x56b360
movq %rax, 0x95c1(%rip)      # 0x16b340
leaq 0x4095e2(%rip), %rax    # 0x56b368
movq %rax, 0x95bb(%rip)      # 0x16b348
movq 0x94e4(%rip), %rax      # 0x16b278
leaq 0x3a65(%rip), %rdi      # 0x165800
leaq 0x95ae(%rip), %rsi      # 0x16b350
popq %rcx
jmpq *%rax
nopl (%rax)