// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
leaq 0x814c(%rip), %rdi      # 0x3221b7
callq 0x1050
movq %rax, 0xc879(%rip)      # 0x3268f0
cmpq $0x0, 0xc871(%rip)      # 0x3268f0
jne 0x31a094
movl $0x14, %edi
leaq 0x8132(%rip), %rsi      # 0x3221bf
movb $0x0, %al
callq 0x10d0
jmp 0x31a096
movq 0xc853(%rip), %rdi      # 0x3268f0
leaq 0x8137(%rip), %rsi      # 0x3221db
callq 0x10c0
movq %rax, 0xc848(%rip)      # 0x3268f8
cmpq $0x0, 0xc840(%rip)      # 0x3268f8
jne 0x31a0cd
movl $0x14, %edi
leaq 0x811e(%rip), %rsi      # 0x3221e4
movb $0x0, %al
callq 0x10d0
jmp 0x31a0cf
jmp 0x31a0d1
movq 0xc818(%rip), %rdi      # 0x3268f0
leaq 0x812c(%rip), %rsi      # 0x32220b
callq 0x10c0
movq %rax, 0xc815(%rip)      # 0x326900
cmpq $0x0, 0xc80d(%rip)      # 0x326900
jne 0x31a108
movl $0x14, %edi
leaq 0x811a(%rip), %rsi      # 0x32221b
movb $0x0, %al
callq 0x10d0
jmp 0x31a10a
jmp 0x31a10c
movq 0xc7dd(%rip), %rdi      # 0x3268f0
leaq 0x8122(%rip), %rsi      # 0x32223c
callq 0x10c0
movq %rax, 0xc7e2(%rip)      # 0x326908
cmpq $0x0, 0xc7da(%rip)      # 0x326908
jne 0x31a143
movl $0x14, %edi
leaq 0x8111(%rip), %rsi      # 0x32224d
movb $0x0, %al
callq 0x10d0
jmp 0x31a145
jmp 0x31a147
movq 0xc7a2(%rip), %rdi      # 0x3268f0
leaq 0x811a(%rip), %rsi      # 0x32226f
callq 0x10c0
movq %rax, 0xc7af(%rip)      # 0x326910
cmpq $0x0, 0xc7a7(%rip)      # 0x326910
jne 0x31a17e
movl $0x14, %edi
leaq 0x8109(%rip), %rsi      # 0x322280
movb $0x0, %al
callq 0x10d0
jmp 0x31a180
jmp 0x31a182
movq 0xc767(%rip), %rdi      # 0x3268f0
leaq 0x8112(%rip), %rsi      # 0x3222a2
callq 0x10c0
movq %rax, 0xc77c(%rip)      # 0x326918
cmpq $0x0, 0xc774(%rip)      # 0x326918
jne 0x31a1b9
movl $0x14, %edi
leaq 0x8101(%rip), %rsi      # 0x3222b3
movb $0x0, %al
callq 0x10d0
jmp 0x31a1bb
jmp 0x31a1bd
movq 0xc72c(%rip), %rdi      # 0x3268f0
leaq 0x810a(%rip), %rsi      # 0x3222d5
callq 0x10c0
movq %rax, 0xc749(%rip)      # 0x326920
cmpq $0x0, 0xc741(%rip)      # 0x326920
jne 0x31a1f4
movl $0x14, %edi
leaq 0x80fa(%rip), %rsi      # 0x3222e7
movb $0x0, %al
callq 0x10d0
jmp 0x31a1f6
jmp 0x31a1f8
movq 0xc6f1(%rip), %rdi      # 0x3268f0
leaq 0x8104(%rip), %rsi      # 0x32230a
callq 0x10c0
movq %rax, 0xc716(%rip)      # 0x326928
cmpq $0x0, 0xc70e(%rip)      # 0x326928
jne 0x31a22f
movl $0x14, %edi
leaq 0x80f4(%rip), %rsi      # 0x32231c
movb $0x0, %al
callq 0x10d0
jmp 0x31a231
jmp 0x31a233
movq 0xc6b6(%rip), %rdi      # 0x3268f0
leaq 0x80fe(%rip), %rsi      # 0x32233f
callq 0x10c0
movq %rax, 0xc6e3(%rip)      # 0x326930
cmpq $0x0, 0xc6db(%rip)      # 0x326930
jne 0x31a26a
movl $0x14, %edi
leaq 0x80ec(%rip), %rsi      # 0x32234f
movb $0x0, %al
callq 0x10d0
jmp 0x31a26c
jmp 0x31a26e
movq 0xc67b(%rip), %rdi      # 0x3268f0
leaq 0x80fa(%rip), %rsi      # 0x322376
callq 0x10c0
movq %rax, 0xc6b0(%rip)      # 0x326938
cmpq $0x0, 0xc6a8(%rip)      # 0x326938
jne 0x31a2a5
movl $0x14, %edi
leaq 0x80e9(%rip), %rsi      # 0x322387
movb $0x0, %al
callq 0x10d0
jmp 0x31a2a7
jmp 0x31a2a9
movq 0xc640(%rip), %rdi      # 0x3268f0
leaq 0x80f8(%rip), %rsi      # 0x3223af
callq 0x10c0
movq %rax, 0xc67d(%rip)      # 0x326940
cmpq $0x0, 0xc675(%rip)      # 0x326940
jne 0x31a2e0
movl $0x14, %edi
leaq 0x80e9(%rip), %rsi      # 0x3223c2
movb $0x0, %al
callq 0x10d0
jmp 0x31a2e2
jmp 0x31a2e4
movq 0xc605(%rip), %rdi      # 0x3268f0
leaq 0x80fa(%rip), %rsi      # 0x3223ec
callq 0x10c0
movq %rax, 0xc64a(%rip)      # 0x326948
cmpq $0x0, 0xc642(%rip)      # 0x326948
jne 0x31a31b
movl $0x14, %edi
leaq 0x80ec(%rip), %rsi      # 0x322400
movb $0x0, %al
callq 0x10d0
jmp 0x31a31d
jmp 0x31a31f
movq 0xc5ca(%rip), %rdi      # 0x3268f0
leaq 0x80fe(%rip), %rsi      # 0x32242b
callq 0x10c0
movq %rax, 0xc617(%rip)      # 0x326950
cmpq $0x0, 0xc60f(%rip)      # 0x326950
jne 0x31a356
movl $0x14, %edi
leaq 0x80eb(%rip), %rsi      # 0x32243a
movb $0x0, %al
callq 0x10d0
jmp 0x31a358
jmp 0x31a35a
movq 0xc58f(%rip), %rdi      # 0x3268f0
leaq 0x80f8(%rip), %rsi      # 0x322460
callq 0x10c0
movq %rax, 0xc5e4(%rip)      # 0x326958
cmpq $0x0, 0xc5dc(%rip)      # 0x326958
jne 0x31a391
movl $0x14, %edi
leaq 0x80e2(%rip), %rsi      # 0x32246c
movb $0x0, %al
callq 0x10d0
jmp 0x31a393
jmp 0x31a395
movq 0xc554(%rip), %rdi      # 0x3268f0
leaq 0x80ec(%rip), %rsi      # 0x32248f
callq 0x10c0
movq %rax, 0xc5b1(%rip)      # 0x326960
cmpq $0x0, 0xc5a9(%rip)      # 0x326960
jne 0x31a3cc
movl $0x14, %edi
leaq 0x80d4(%rip), %rsi      # 0x322499
movb $0x0, %al
callq 0x10d0
jmp 0x31a3ce
jmp 0x31a3d0
movq 0xc519(%rip), %rdi      # 0x3268f0
leaq 0x80dc(%rip), %rsi      # 0x3224ba
callq 0x10c0
movq %rax, 0xc57e(%rip)      # 0x326968
cmpq $0x0, 0xc576(%rip)      # 0x326968
jne 0x31a407
movl $0x14, %edi
leaq 0x80cc(%rip), %rsi      # 0x3224cc
movb $0x0, %al
callq 0x10d0
jmp 0x31a409
jmp 0x31a40b
movq 0xc4de(%rip), %rdi      # 0x3268f0
leaq 0x80dc(%rip), %rsi      # 0x3224f5
callq 0x10c0
movq %rax, 0xc54b(%rip)      # 0x326970
cmpq $0x0, 0xc543(%rip)      # 0x326970
jne 0x31a442
movl $0x14, %edi
leaq 0x80ca(%rip), %rsi      # 0x322505
movb $0x0, %al
callq 0x10d0
jmp 0x31a444
jmp 0x31a446
movq 0xc4a3(%rip), %rdi      # 0x3268f0
leaq 0x80d8(%rip), %rsi      # 0x32252c
callq 0x10c0
movq %rax, 0xc518(%rip)      # 0x326978
cmpq $0x0, 0xc510(%rip)      # 0x326978
jne 0x31a47d
movl $0x14, %edi
leaq 0x80c1(%rip), %rsi      # 0x322537
movb $0x0, %al
callq 0x10d0
jmp 0x31a47f
jmp 0x31a481
movq 0xc468(%rip), %rdi      # 0x3268f0
leaq 0x80ca(%rip), %rsi      # 0x322559
callq 0x10c0
movq %rax, 0xc4e5(%rip)      # 0x326980
cmpq $0x0, 0xc4dd(%rip)      # 0x326980
jne 0x31a4b8
movl $0x14, %edi
leaq 0x80b3(%rip), %rsi      # 0x322564
movb $0x0, %al
callq 0x10d0
jmp 0x31a4ba
jmp 0x31a4bc
movq 0xc42d(%rip), %rdi      # 0x3268f0
leaq 0x80bc(%rip), %rsi      # 0x322586
callq 0x10c0
movq %rax, 0xc4b2(%rip)      # 0x326988
cmpq $0x0, 0xc4aa(%rip)      # 0x326988
jne 0x31a4f3
movl $0x14, %edi
leaq 0x80a5(%rip), %rsi      # 0x322591
movb $0x0, %al
callq 0x10d0
jmp 0x31a4f5
jmp 0x31a4f7
movq 0xc3f2(%rip), %rdi      # 0x3268f0
leaq 0x80ae(%rip), %rsi      # 0x3225b3
callq 0x10c0
movq %rax, 0xc47f(%rip)      # 0x326990
cmpq $0x0, 0xc477(%rip)      # 0x326990
jne 0x31a52e
movl $0x14, %edi
leaq 0x8096(%rip), %rsi      # 0x3225bd
movb $0x0, %al
callq 0x10d0
jmp 0x31a530
jmp 0x31a532
movq 0xc3b7(%rip), %rdi      # 0x3268f0
leaq 0x809e(%rip), %rsi      # 0x3225de
callq 0x10c0
movq %rax, 0xc44c(%rip)      # 0x326998
cmpq $0x0, 0xc444(%rip)      # 0x326998
jne 0x31a569
movl $0x14, %edi
leaq 0x8086(%rip), %rsi      # 0x3225e8
movb $0x0, %al
callq 0x10d0
jmp 0x31a56b
jmp 0x31a56d
movq 0xc37c(%rip), %rdi      # 0x3268f0
leaq 0x808e(%rip), %rsi      # 0x322609
callq 0x10c0
movq %rax, 0xc419(%rip)      # 0x3269a0
cmpq $0x0, 0xc411(%rip)      # 0x3269a0
jne 0x31a5a4
movl $0x14, %edi
leaq 0x8076(%rip), %rsi      # 0x322613
movb $0x0, %al
callq 0x10d0
jmp 0x31a5a6
leaq 0x3523(%rip), %rax      # 0x31dad0
movq %rax, 0xc3f4(%rip)      # 0x3269a8
leaq 0x3a45(%rip), %rax      # 0x31e000
movq %rax, 0xc3ee(%rip)      # 0x3269b0
leaq -0xdc9(%rip), %rax      # 0x319800
movq %rax, 0xc3e8(%rip)      # 0x3269b8
leaq 0x40c409(%rip), %rax    # 0x7269e0
movq %rax, 0xc3e2(%rip)      # 0x3269c0
leaq 0x40c403(%rip), %rax    # 0x7269e8
movq %rax, 0xc3dc(%rip)      # 0x3269c8
leaq 0x8041(%rip), %rdi      # 0x322634
leaq 0xc3d6(%rip), %rsi      # 0x3269d0
leaq 0xc3a7(%rip), %rdx      # 0x3269a8
callq *0xc2f1(%rip)           # 0x3268f8
popq %rbp
retq
nopl (%rax)