// File: /workspace/github_c_makefile_star2_O3/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 0x1717a1
cmpl $0xb0, %edi
je 0x17176c
cmpl $0xa0, %edi
jne 0x171915
leaq 0x9c12(%rip), %r14      # 0x17b350
movq (%r14), %rax
movl 0x24(%rax), %ebx
leal -0x10(%rbx), %eax
cmpl $0xb, %eax
ja 0x1717e1
leaq 0x44f9(%rip), %rcx      # 0x175c50
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x40b(%rip), %rdi      # 0x17135c
jmp 0x171902
leaq 0x9bdd(%rip), %r14      # 0x17b350
movq (%r14), %rax
movl 0x24(%rax), %ebx
leal -0x7(%rbx), %eax
cmpl $0x5, %eax
ja 0x171809
leaq 0x44ac(%rip), %rcx      # 0x175c38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x19b(%rip), %rdi      # 0x171601
jmp 0x171902
leaq 0x9ba8(%rip), %rax      # 0x17b350
movq (%rax), %rax
movl 0x24(%rax), %ebx
leaq 0x9b53(%rip), %rax      # 0x17b308
movl %ebx, %edi
callq *(%rax)
leaq 0x4528(%rip), %rsi      # 0x175ce8
movl $0x15, %edi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x9b48(%rip), %rax      # 0x17b320
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
leal -0x27(%rbx), %eax
cmpl $0x7, %eax
ja 0x1718b1
leaq 0x448c(%rip), %rcx      # 0x175c80
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x33a(%rip), %rdi      # 0x1714ca
jmp 0x171902
cmpl $0x17, %ebx
jne 0x171834
callq 0x17327a
leaq 0x9ab6(%rip), %rax      # 0x17b2d0
xorl %edi, %edi
movl $0x2000000, %esi        # imm = 0x2000000
callq *(%rax)
movl $0xe, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x171fb4
leaq 0x9ac5(%rip), %rax      # 0x17b300
movl %ebx, %edi
callq *(%rax)
leaq 0x447e(%rip), %rsi      # 0x175cc4
movl $0x15, %edi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x9aba(%rip), %rax      # 0x17b318
jmp 0x1717d8
leaq -0x1bf(%rip), %rdi      # 0x1716ab
jmp 0x171902
leaq -0x18c(%rip), %rdi      # 0x1716ea
jmp 0x171902
leaq -0x218(%rip), %rdi      # 0x17166a
jmp 0x171902
leaq -0x423(%rip), %rdi      # 0x171468
jmp 0x171902
leaq -0x4dc(%rip), %rdi      # 0x1713b8
jmp 0x171902
leaq -0x532(%rip), %rdi      # 0x17136b
jmp 0x171902
leaq -0x499(%rip), %rdi      # 0x17140d
jmp 0x171902
leaq -0x40c(%rip), %rdi      # 0x1714a3
jmp 0x171902
leaq 0x9a40(%rip), %rax      # 0x17b2f8
movl %ebx, %edi
callq *(%rax)
leaq 0x43dd(%rip), %rsi      # 0x175ca0
movl $0x15, %edi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x9a35(%rip), %rax      # 0x17b310
jmp 0x1717d8
leaq -0x3d4(%rip), %rdi      # 0x171513
jmp 0x171902
leaq -0x3b2(%rip), %rdi      # 0x17153e
jmp 0x171902
leaq -0x37c(%rip), %rdi      # 0x17157d
jmp 0x171902
leaq -0x33c(%rip), %rdi      # 0x1715c6
callq 0x173186
movq (%r14), %rax
movl 0x7c(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x43f0(%rip), %rsi      # 0x175d0c
movl $0x15, %edi
xorl %eax, %eax
callq 0x1060
callq 0x1070
nopl (%rax)