// File: /workspace/github_c_makefile_star2_O1/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 0x161598
cmpl $0xb0, %edi
je 0x161563
cmpl $0xa0, %edi
jne 0x16170c
leaq 0x9e1b(%rip), %r14      # 0x16b350
movq (%r14), %rax
movl 0x24(%rax), %ebx
leal -0x10(%rbx), %eax
cmpl $0xb, %eax
ja 0x1615d8
leaq 0x3d5e(%rip), %rcx      # 0x1652ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x436(%rip), %rdi      # 0x161128
jmp 0x1616f9
leaq 0x9de6(%rip), %r14      # 0x16b350
movq (%r14), %rax
movl 0x24(%rax), %ebx
leal -0x7(%rbx), %eax
cmpl $0x5, %eax
ja 0x161600
leaq 0x3d11(%rip), %rcx      # 0x165294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x1b9(%rip), %rdi      # 0x1613da
jmp 0x1616f9
leaq 0x9db1(%rip), %rax      # 0x16b350
movq (%rax), %rax
movl 0x24(%rax), %ebx
leaq 0x9d5c(%rip), %rax      # 0x16b308
movl %ebx, %edi
callq *(%rax)
leaq 0x3d8d(%rip), %rsi      # 0x165344
movl $0x15, %edi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x9d51(%rip), %rax      # 0x16b320
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
leal -0x27(%rbx), %eax
cmpl $0x7, %eax
ja 0x1616a8
leaq 0x3cf1(%rip), %rcx      # 0x1652dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x358(%rip), %rdi      # 0x1612a3
jmp 0x1616f9
cmpl $0x17, %ebx
jne 0x16162b
callq 0x16305e
leaq 0x9cbf(%rip), %rax      # 0x16b2d0
xorl %edi, %edi
movl $0x2000000, %esi        # imm = 0x2000000
callq *(%rax)
movl $0xe, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x161da8
leaq 0x9cce(%rip), %rax      # 0x16b300
movl %ebx, %edi
callq *(%rax)
leaq 0x3ce3(%rip), %rsi      # 0x165320
movl $0x15, %edi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x9cc3(%rip), %rax      # 0x16b318
jmp 0x1615cf
leaq -0x1bf(%rip), %rdi      # 0x1614a2
jmp 0x1616f9
leaq -0x18c(%rip), %rdi      # 0x1614e1
jmp 0x1616f9
leaq -0x236(%rip), %rdi      # 0x161443
jmp 0x1616f9
leaq -0x441(%rip), %rdi      # 0x161241
jmp 0x1616f9
leaq -0x507(%rip), %rdi      # 0x161184
jmp 0x1616f9
leaq -0x55d(%rip), %rdi      # 0x161137
jmp 0x1616f9
leaq -0x4c5(%rip), %rdi      # 0x1611d8
jmp 0x1616f9
leaq -0x42a(%rip), %rdi      # 0x16127c
jmp 0x1616f9
leaq 0x9c49(%rip), %rax      # 0x16b2f8
movl %ebx, %edi
callq *(%rax)
leaq 0x3c42(%rip), %rsi      # 0x1652fc
movl $0x15, %edi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1100
leaq 0x9c3e(%rip), %rax      # 0x16b310
jmp 0x1615cf
leaq -0x3f2(%rip), %rdi      # 0x1612ec
jmp 0x1616f9
leaq -0x3d0(%rip), %rdi      # 0x161317
jmp 0x1616f9
leaq -0x39a(%rip), %rdi      # 0x161356
jmp 0x1616f9
leaq -0x35a(%rip), %rdi      # 0x16139f
callq 0x162f4e
movq (%r14), %rax
movl 0x7c(%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3c55(%rip), %rsi      # 0x165368
movl $0x15, %edi
xorl %eax, %eax
callq 0x1060
callq 0x1070