// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_Execute
uint32_t BIOS_Execute(uint32_t address)
{
	switch (address)
	{
	case 0xA0:
		switch (T1)
		{
		CASE_METHOD(0x10,BIOS_AToI);
		CASE_METHOD(0x15,BIOS_StrCat);
		CASE_METHOD(0x17,BIOS_StrCmp);
		CASE_METHOD(0x18,BIOS_StrNCmp);
		CASE_METHOD(0x19,BIOS_StrCpy);
		CASE_METHOD(0x1B,BIOS_StrLen);
		CASE_METHOD(0x27,BIOS_BCopy);
		CASE_METHOD(0x28,BIOS_BZero);
		CASE_METHOD(0x2A,BIOS_MemCpy);
		CASE_METHOD(0x2B,BIOS_MemSet);
		CASE_METHOD(0x2E,BIOS_MemChr);
		default:
			SDL_LogDebug(LOG_BIOS,"Unrecognized BIOS(A0) method: %i:%s",T1,PCSX_A0Name(T1));
			return PCSX_HLEA0();
		}
		break;
	case 0xB0:
		switch (T1)
		{
		CASE_METHOD(0x7,BIOS_DeliverEvent);
		CASE_METHOD(0x8,BIOS_OpenEvent);
		CASE_METHOD(0xB,BIOS_TestEvent);
		CASE_METHOD(0xC,BIOS_EnableEvent);
		case 0x17:
			EMU_LoadRegisters();
			PCSX_ExecuteCOP(0,16 << 21);
			return COP0_GetRegister(14);
		default:
			SDL_LogDebug(LOG_BIOS,"Unrecognized BIOS(B0) method: %i:%s",T1,PCSX_B0Name(T1));
			return PCSX_HLEB0();
		}
		break;
	case 0xC0:
		switch (T1)
		{
		default:
			SDL_LogDebug(LOG_BIOS,"Unrecognized BIOS(C0) method: %i:%s",T1,PCSX_C0Name(T1));
			return PCSX_HLEC0();
		}
		break;
	default:
		SDL_LogCritical(LOG_BIOS,"Invalid BIOS routine class");
		abort();
		break;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0xc0, %edi
je 0x134b1c
cmpl $0xb0, %edi
je 0x134ae7
cmpl $0xa0, %edi
jne 0x134c88
leaq 0x25897(%rip), %r14     # 0x15a350
movq (%r14), %rax
movl 0x24(%rax), %ebx
leal -0x10(%rbx), %eax
cmpl $0xb, %eax
ja 0x134b5a
leaq 0x3ebe(%rip), %rcx      # 0x138990
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x3ae(%rip), %rdi      # 0x134734
jmp 0x134c75
leaq 0x25862(%rip), %r14     # 0x15a350
movq (%r14), %rax
movl 0x24(%rax), %ebx
leal -0x7(%rbx), %eax
cmpl $0x5, %eax
ja 0x134b82
leaq 0x3e71(%rip), %rcx      # 0x138978
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x186(%rip), %rdi      # 0x134991
jmp 0x134c75
leaq 0x2582d(%rip), %rax     # 0x15a350
movq (%rax), %rax
movl 0x24(%rax), %ebx
leaq 0x257d8(%rip), %rax     # 0x15a308
movl %ebx, %edi
callq *(%rax)
leaq 0x3eed(%rip), %rsi      # 0x138a28
pushq $0x15
popq %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x257cf(%rip), %rax     # 0x15a320
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
leal -0x27(%rbx), %eax
cmpl $0x7, %eax
ja 0x134c26
leaq 0x3e53(%rip), %rcx      # 0x1389c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x2fa(%rip), %rdi      # 0x134883
jmp 0x134c75
cmpl $0x17, %ebx
jne 0x134bab
callq 0x1364bf
leaq 0x2573d(%rip), %rax     # 0x15a2d0
xorl %edi, %edi
movl $0x2000000, %esi        # imm = 0x2000000
callq *(%rax)
pushq $0xe
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1352d4
leaq 0x2574e(%rip), %rax     # 0x15a300
movl %ebx, %edi
callq *(%rax)
leaq 0x3e47(%rip), %rsi      # 0x138a04
pushq $0x15
popq %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x25745(%rip), %rax     # 0x15a318
jmp 0x134b51
leaq -0x1a7(%rip), %rdi      # 0x134a38
jmp 0x134c75
leaq -0x17d(%rip), %rdi      # 0x134a6e
jmp 0x134c75
leaq -0x200(%rip), %rdi      # 0x1349f7
jmp 0x134c75
leaq -0x3e1(%rip), %rdi      # 0x13481f
jmp 0x134c75
leaq -0x475(%rip), %rdi      # 0x134794
jmp 0x134c75
leaq -0x4cf(%rip), %rdi      # 0x134743
jmp 0x134c75
leaq -0x44c(%rip), %rdi      # 0x1347cf
jmp 0x134c75
leaq -0x3c6(%rip), %rdi      # 0x13485e
jmp 0x134c75
leaq 0x256cb(%rip), %rax     # 0x15a2f8
movl %ebx, %edi
callq *(%rax)
leaq 0x3da8(%rip), %rsi      # 0x1389e0
pushq $0x15
popq %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x256c2(%rip), %rax     # 0x15a310
jmp 0x134b51
leaq -0x38b(%rip), %rdi      # 0x1348cf
jmp 0x134c75
leaq -0x38b(%rip), %rdi      # 0x1348d8
jmp 0x134c75
leaq -0x352(%rip), %rdi      # 0x13491a
jmp 0x134c75
leaq -0x30f(%rip), %rdi      # 0x134966
callq 0x1363c8
movq (%r14), %rax
movl 0x7c(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3dbd(%rip), %rsi      # 0x138a4c
pushq $0x15
popq %rdi
xorl %eax, %eax
callq 0x1060
callq 0x1070
nop