// File: /workspace/github_c_makefile_star2_O2/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 0x3c3f(%rip), %rdi      # 0x138a67
callq 0x1050
movq %rax, 0x2543c(%rip)     # 0x15a270
testq %rax, %rax
jne 0x134e51
leaq 0x3c2f(%rip), %rsi      # 0x138a6f
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2541f(%rip), %rax     # 0x15a270
leaq 0x3c33(%rip), %rsi      # 0x138a8b
movq %rax, %rdi
callq 0x10c0
movq %rax, 0x25411(%rip)     # 0x15a278
testq %rax, %rax
jne 0x134e7d
leaq 0x3c21(%rip), %rsi      # 0x138a94
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x253ec(%rip), %rdi     # 0x15a270
leaq 0x3c30(%rip), %rsi      # 0x138abb
callq 0x10c0
movq %rax, 0x253e9(%rip)     # 0x15a280
testq %rax, %rax
jne 0x134ead
leaq 0x3c28(%rip), %rsi      # 0x138acb
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x253bc(%rip), %rdi     # 0x15a270
leaq 0x3c31(%rip), %rsi      # 0x138aec
callq 0x10c0
movq %rax, 0x253c1(%rip)     # 0x15a288
testq %rax, %rax
jne 0x134edd
leaq 0x3c2a(%rip), %rsi      # 0x138afd
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2538c(%rip), %rdi     # 0x15a270
leaq 0x3c34(%rip), %rsi      # 0x138b1f
callq 0x10c0
movq %rax, 0x25399(%rip)     # 0x15a290
testq %rax, %rax
jne 0x134f0d
leaq 0x3c2d(%rip), %rsi      # 0x138b30
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2535c(%rip), %rdi     # 0x15a270
leaq 0x3c37(%rip), %rsi      # 0x138b52
callq 0x10c0
movq %rax, 0x25371(%rip)     # 0x15a298
testq %rax, %rax
jne 0x134f3d
leaq 0x3c30(%rip), %rsi      # 0x138b63
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2532c(%rip), %rdi     # 0x15a270
leaq 0x3c3a(%rip), %rsi      # 0x138b85
callq 0x10c0
movq %rax, 0x25349(%rip)     # 0x15a2a0
testq %rax, %rax
jne 0x134f6d
leaq 0x3c34(%rip), %rsi      # 0x138b97
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x252fc(%rip), %rdi     # 0x15a270
leaq 0x3c3f(%rip), %rsi      # 0x138bba
callq 0x10c0
movq %rax, 0x25321(%rip)     # 0x15a2a8
testq %rax, %rax
jne 0x134f9d
leaq 0x3c39(%rip), %rsi      # 0x138bcc
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x252cc(%rip), %rdi     # 0x15a270
leaq 0x3c44(%rip), %rsi      # 0x138bef
callq 0x10c0
movq %rax, 0x252f9(%rip)     # 0x15a2b0
testq %rax, %rax
jne 0x134fcd
leaq 0x3c3c(%rip), %rsi      # 0x138bff
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2529c(%rip), %rdi     # 0x15a270
leaq 0x3c4b(%rip), %rsi      # 0x138c26
callq 0x10c0
movq %rax, 0x252d1(%rip)     # 0x15a2b8
testq %rax, %rax
jne 0x134ffd
leaq 0x3c44(%rip), %rsi      # 0x138c37
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2526c(%rip), %rdi     # 0x15a270
leaq 0x3c54(%rip), %rsi      # 0x138c5f
callq 0x10c0
movq %rax, 0x252a9(%rip)     # 0x15a2c0
testq %rax, %rax
jne 0x13502d
leaq 0x3c4f(%rip), %rsi      # 0x138c72
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2523c(%rip), %rdi     # 0x15a270
leaq 0x3c61(%rip), %rsi      # 0x138c9c
callq 0x10c0
movq %rax, 0x25281(%rip)     # 0x15a2c8
testq %rax, %rax
jne 0x13505d
leaq 0x3c5d(%rip), %rsi      # 0x138cb0
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2520c(%rip), %rdi     # 0x15a270
leaq 0x3c70(%rip), %rsi      # 0x138cdb
callq 0x10c0
movq %rax, 0x25259(%rip)     # 0x15a2d0
testq %rax, %rax
jne 0x13508d
leaq 0x3c67(%rip), %rsi      # 0x138cea
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x251dc(%rip), %rdi     # 0x15a270
leaq 0x3c75(%rip), %rsi      # 0x138d10
callq 0x10c0
movq %rax, 0x25231(%rip)     # 0x15a2d8
testq %rax, %rax
jne 0x1350bd
leaq 0x3c69(%rip), %rsi      # 0x138d1c
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x251ac(%rip), %rdi     # 0x15a270
leaq 0x3c74(%rip), %rsi      # 0x138d3f
callq 0x10c0
movq %rax, 0x25209(%rip)     # 0x15a2e0
testq %rax, %rax
jne 0x1350ed
leaq 0x3c66(%rip), %rsi      # 0x138d49
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2517c(%rip), %rdi     # 0x15a270
leaq 0x3c6f(%rip), %rsi      # 0x138d6a
callq 0x10c0
movq %rax, 0x251e1(%rip)     # 0x15a2e8
testq %rax, %rax
jne 0x13511d
leaq 0x3c69(%rip), %rsi      # 0x138d7c
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2514c(%rip), %rdi     # 0x15a270
leaq 0x3c7a(%rip), %rsi      # 0x138da5
callq 0x10c0
movq %rax, 0x251b9(%rip)     # 0x15a2f0
testq %rax, %rax
jne 0x13514d
leaq 0x3c72(%rip), %rsi      # 0x138db5
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2511c(%rip), %rdi     # 0x15a270
leaq 0x3c81(%rip), %rsi      # 0x138ddc
callq 0x10c0
movq %rax, 0x25191(%rip)     # 0x15a2f8
testq %rax, %rax
jne 0x13517d
leaq 0x3c74(%rip), %rsi      # 0x138de7
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x250ec(%rip), %rdi     # 0x15a270
leaq 0x3c7e(%rip), %rsi      # 0x138e09
callq 0x10c0
movq %rax, 0x25169(%rip)     # 0x15a300
testq %rax, %rax
jne 0x1351ad
leaq 0x3c71(%rip), %rsi      # 0x138e14
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x250bc(%rip), %rdi     # 0x15a270
leaq 0x3c7b(%rip), %rsi      # 0x138e36
callq 0x10c0
movq %rax, 0x25141(%rip)     # 0x15a308
testq %rax, %rax
jne 0x1351dd
leaq 0x3c6e(%rip), %rsi      # 0x138e41
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2508c(%rip), %rdi     # 0x15a270
leaq 0x3c78(%rip), %rsi      # 0x138e63
callq 0x10c0
movq %rax, 0x25119(%rip)     # 0x15a310
testq %rax, %rax
jne 0x13520d
leaq 0x3c6a(%rip), %rsi      # 0x138e6d
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2505c(%rip), %rdi     # 0x15a270
leaq 0x3c73(%rip), %rsi      # 0x138e8e
callq 0x10c0
movq %rax, 0x250f1(%rip)     # 0x15a318
testq %rax, %rax
jne 0x13523d
leaq 0x3c65(%rip), %rsi      # 0x138e98
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x2502c(%rip), %rdi     # 0x15a270
leaq 0x3c6e(%rip), %rsi      # 0x138eb9
callq 0x10c0
movq %rax, 0x250c9(%rip)     # 0x15a320
testq %rax, %rax
jne 0x13526d
leaq 0x3c60(%rip), %rsi      # 0x138ec3
pushq $0x14
popq %rdi
xorl %eax, %eax
callq 0x10d0
leaq 0xee3(%rip), %rax       # 0x136157
movq %rax, 0x250ad(%rip)     # 0x15a328
leaq 0x250a6(%rip), %rdx     # 0x15a328
leaq 0x121e(%rip), %rax      # 0x1364a7
movq %rax, 0x250a0(%rip)     # 0x15a330
leaq -0x906(%rip), %rax      # 0x134991
movq %rax, 0x2509a(%rip)     # 0x15a338
leaq 0x4250bb(%rip), %rax    # 0x55a360
movq %rax, 0x25094(%rip)     # 0x15a340
leaq 0x4250b5(%rip), %rax    # 0x55a368
movq %rax, 0x2508e(%rip)     # 0x15a348
movq 0x24fb7(%rip), %rax     # 0x15a278
leaq 0x3c1c(%rip), %rdi      # 0x138ee4
leaq 0x25081(%rip), %rsi     # 0x15a350
popq %rcx
jmpq *%rax
nop