// File: /workspace/github_c_makefile_star2_O3/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 0x424b(%rip), %rdi      # 0x175d27
callq 0x1050
movq %rax, 0x9788(%rip)      # 0x17b270
testq %rax, %rax
jne 0x171b07
leaq 0x423b(%rip), %rsi      # 0x175d2f
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9769(%rip), %rax      # 0x17b270
leaq 0x423d(%rip), %rsi      # 0x175d4b
movq %rax, %rdi
callq 0x10c0
movq %rax, 0x975b(%rip)      # 0x17b278
testq %rax, %rax
jne 0x171b35
leaq 0x422b(%rip), %rsi      # 0x175d54
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9734(%rip), %rdi      # 0x17b270
leaq 0x4238(%rip), %rsi      # 0x175d7b
callq 0x10c0
movq %rax, 0x9731(%rip)      # 0x17b280
testq %rax, %rax
jne 0x171b67
leaq 0x4230(%rip), %rsi      # 0x175d8b
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9702(%rip), %rdi      # 0x17b270
leaq 0x4237(%rip), %rsi      # 0x175dac
callq 0x10c0
movq %rax, 0x9707(%rip)      # 0x17b288
testq %rax, %rax
jne 0x171b99
leaq 0x4230(%rip), %rsi      # 0x175dbd
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x96d0(%rip), %rdi      # 0x17b270
leaq 0x4238(%rip), %rsi      # 0x175ddf
callq 0x10c0
movq %rax, 0x96dd(%rip)      # 0x17b290
testq %rax, %rax
jne 0x171bcb
leaq 0x4231(%rip), %rsi      # 0x175df0
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x969e(%rip), %rdi      # 0x17b270
leaq 0x4239(%rip), %rsi      # 0x175e12
callq 0x10c0
movq %rax, 0x96b3(%rip)      # 0x17b298
testq %rax, %rax
jne 0x171bfd
leaq 0x4232(%rip), %rsi      # 0x175e23
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x966c(%rip), %rdi      # 0x17b270
leaq 0x423a(%rip), %rsi      # 0x175e45
callq 0x10c0
movq %rax, 0x9689(%rip)      # 0x17b2a0
testq %rax, %rax
jne 0x171c2f
leaq 0x4234(%rip), %rsi      # 0x175e57
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x963a(%rip), %rdi      # 0x17b270
leaq 0x423d(%rip), %rsi      # 0x175e7a
callq 0x10c0
movq %rax, 0x965f(%rip)      # 0x17b2a8
testq %rax, %rax
jne 0x171c61
leaq 0x4237(%rip), %rsi      # 0x175e8c
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9608(%rip), %rdi      # 0x17b270
leaq 0x4240(%rip), %rsi      # 0x175eaf
callq 0x10c0
movq %rax, 0x9635(%rip)      # 0x17b2b0
testq %rax, %rax
jne 0x171c93
leaq 0x4238(%rip), %rsi      # 0x175ebf
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x95d6(%rip), %rdi      # 0x17b270
leaq 0x4245(%rip), %rsi      # 0x175ee6
callq 0x10c0
movq %rax, 0x960b(%rip)      # 0x17b2b8
testq %rax, %rax
jne 0x171cc5
leaq 0x423e(%rip), %rsi      # 0x175ef7
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x95a4(%rip), %rdi      # 0x17b270
leaq 0x424c(%rip), %rsi      # 0x175f1f
callq 0x10c0
movq %rax, 0x95e1(%rip)      # 0x17b2c0
testq %rax, %rax
jne 0x171cf7
leaq 0x4247(%rip), %rsi      # 0x175f32
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9572(%rip), %rdi      # 0x17b270
leaq 0x4257(%rip), %rsi      # 0x175f5c
callq 0x10c0
movq %rax, 0x95b7(%rip)      # 0x17b2c8
testq %rax, %rax
jne 0x171d29
leaq 0x4253(%rip), %rsi      # 0x175f70
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9540(%rip), %rdi      # 0x17b270
leaq 0x4264(%rip), %rsi      # 0x175f9b
callq 0x10c0
movq %rax, 0x958d(%rip)      # 0x17b2d0
testq %rax, %rax
jne 0x171d5b
leaq 0x425b(%rip), %rsi      # 0x175faa
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x950e(%rip), %rdi      # 0x17b270
leaq 0x4267(%rip), %rsi      # 0x175fd0
callq 0x10c0
movq %rax, 0x9563(%rip)      # 0x17b2d8
testq %rax, %rax
jne 0x171d8d
leaq 0x425b(%rip), %rsi      # 0x175fdc
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x94dc(%rip), %rdi      # 0x17b270
leaq 0x4264(%rip), %rsi      # 0x175fff
callq 0x10c0
movq %rax, 0x9539(%rip)      # 0x17b2e0
testq %rax, %rax
jne 0x171dbf
leaq 0x4256(%rip), %rsi      # 0x176009
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x94aa(%rip), %rdi      # 0x17b270
leaq 0x425d(%rip), %rsi      # 0x17602a
callq 0x10c0
movq %rax, 0x950f(%rip)      # 0x17b2e8
testq %rax, %rax
jne 0x171df1
leaq 0x4257(%rip), %rsi      # 0x17603c
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9478(%rip), %rdi      # 0x17b270
leaq 0x4266(%rip), %rsi      # 0x176065
callq 0x10c0
movq %rax, 0x94e5(%rip)      # 0x17b2f0
testq %rax, %rax
jne 0x171e23
leaq 0x425e(%rip), %rsi      # 0x176075
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9446(%rip), %rdi      # 0x17b270
leaq 0x426b(%rip), %rsi      # 0x17609c
callq 0x10c0
movq %rax, 0x94bb(%rip)      # 0x17b2f8
testq %rax, %rax
jne 0x171e55
leaq 0x425e(%rip), %rsi      # 0x1760a7
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x9414(%rip), %rdi      # 0x17b270
leaq 0x4266(%rip), %rsi      # 0x1760c9
callq 0x10c0
movq %rax, 0x9491(%rip)      # 0x17b300
testq %rax, %rax
jne 0x171e87
leaq 0x4259(%rip), %rsi      # 0x1760d4
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x93e2(%rip), %rdi      # 0x17b270
leaq 0x4261(%rip), %rsi      # 0x1760f6
callq 0x10c0
movq %rax, 0x9467(%rip)      # 0x17b308
testq %rax, %rax
jne 0x171eb9
leaq 0x4254(%rip), %rsi      # 0x176101
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x93b0(%rip), %rdi      # 0x17b270
leaq 0x425c(%rip), %rsi      # 0x176123
callq 0x10c0
movq %rax, 0x943d(%rip)      # 0x17b310
testq %rax, %rax
jne 0x171eeb
leaq 0x424e(%rip), %rsi      # 0x17612d
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x937e(%rip), %rdi      # 0x17b270
leaq 0x4255(%rip), %rsi      # 0x17614e
callq 0x10c0
movq %rax, 0x9413(%rip)      # 0x17b318
testq %rax, %rax
jne 0x171f1d
leaq 0x4247(%rip), %rsi      # 0x176158
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x934c(%rip), %rdi      # 0x17b270
leaq 0x424e(%rip), %rsi      # 0x176179
callq 0x10c0
movq %rax, 0x93e9(%rip)      # 0x17b320
testq %rax, %rax
jne 0x171f4f
leaq 0x4240(%rip), %rsi      # 0x176183
movl $0x14, %edi
xorl %eax, %eax
callq 0x10d0
leaq 0xfc1(%rip), %rax       # 0x172f17
movq %rax, 0x93cb(%rip)      # 0x17b328
leaq 0x93c4(%rip), %rdx      # 0x17b328
leaq 0x12f7(%rip), %rax      # 0x173262
movq %rax, 0x93be(%rip)      # 0x17b330
leaq -0x978(%rip), %rax      # 0x171601
movq %rax, 0x93b8(%rip)      # 0x17b338
leaq 0x4093d9(%rip), %rax    # 0x57b360
movq %rax, 0x93b2(%rip)      # 0x17b340
leaq 0x4093d3(%rip), %rax    # 0x57b368
movq %rax, 0x93ac(%rip)      # 0x17b348
movq 0x92d5(%rip), %rax      # 0x17b278
leaq 0x41fa(%rip), %rdi      # 0x1761a4
leaq 0x939f(%rip), %rsi      # 0x17b350
popq %rcx
jmpq *%rax