	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PpcVirt2phys                   ## -- Begin function PpcVirt2phys
	.p2align	4, 0x90
_PpcVirt2phys:                          ## @PpcVirt2phys
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movl	%edi, %r12d
	xorl	%eax, %eax
	callq	_GetMSR
	xorl	%ecx, %ecx
	testl	%ebx, %ebx
	setne	%cl
	shll	$4, %ecx
	addl	$16, %ecx
	testl	%ecx, %eax
	je	LBB0_1
## %bb.2:
	movl	%r12d, %edi
	sarl	$28, %edi
	callq	_GetSR
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_19
## %bb.3:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_GetBat
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	movl	%r12d, %edx
	callq	_BatHit
	testq	%rax, %rax
	jne	LBB0_20
## %bb.4:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movl	$1, %edi
	movl	%ebx, %esi
	callq	_GetBat
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	movl	%r12d, %edx
	callq	_BatHit
	testq	%rax, %rax
	jne	LBB0_20
## %bb.5:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movl	$2, %edi
	movl	%ebx, %esi
	callq	_GetBat
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	movl	%r12d, %edx
	callq	_BatHit
	testq	%rax, %rax
	jne	LBB0_20
## %bb.6:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movl	$3, %edi
	movl	%ebx, %esi
	callq	_GetBat
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	movl	%r12d, %edx
	callq	_BatHit
	testq	%rax, %rax
	je	LBB0_7
LBB0_20:
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	movl	%r12d, %edx
	callq	_BatTranslate
	jmp	LBB0_18
LBB0_1:
	movl	%r12d, %eax
	jmp	LBB0_18
LBB0_19:
	andl	$268435455, %r12d               ## imm = 0xFFFFFFF
	shll	$28, %r14d
	orl	%r12d, %r14d
	movl	%r14d, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%eax, %eax
	callq	_GetSDR1
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %esi
	andl	$-65536, %esi                   ## imm = 0xFFFF0000
	shll	$10, %eax
	andl	$523264, %eax                   ## imm = 0x7FC00
	orl	$1023, %eax                     ## imm = 0x3FF
	movl	%r14d, %edx
	andl	$524287, %edx                   ## imm = 0x7FFFF
	movl	%r12d, %ecx
	shrl	$12, %ecx
	movzwl	%cx, %edi
	xorl	%edx, %edi
	movl	%r12d, %ecx
	shrl	$22, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edi, -56(%rbp)                 ## 4-byte Spill
	movl	%edi, %ebx
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	andl	%eax, %ebx
	shll	$6, %ebx
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	addl	%esi, %ebx
	movl	$8, %r15d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	$8, %ebx
	decl	%r15d
	je	LBB0_13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_GetPhys
	movl	%eax, %r13d
	leal	4(%rbx), %edi
	callq	_GetPhys
	testb	$64, %r13b
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%r13d, %ecx
	shrl	$7, %ecx
	xorl	%r14d, %ecx
	testl	$16777215, %ecx                 ## imm = 0xFFFFFF
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	-52(%rbp), %r13d                ## 4-byte Folded Reload
	testb	$63, %r13b
	jne	LBB0_12
	jmp	LBB0_11
LBB0_13:
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	notl	%eax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	andl	%eax, %ebx
	shll	$6, %ebx
	addl	-60(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	$8, %r15d
	jmp	LBB0_14
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	addl	$8, %ebx
	movl	$-1, %eax
	decl	%r15d
	je	LBB0_18
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_GetPhys
	movl	%eax, %r13d
	leal	4(%rbx), %edi
	callq	_GetPhys
	testb	$64, %r13b
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r13d, %ecx
	shrl	$7, %ecx
	xorl	%r14d, %ecx
	testl	$16777215, %ecx                 ## imm = 0xFFFFFF
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	-52(%rbp), %r13d                ## 4-byte Folded Reload
	testb	$63, %r13b
	jne	LBB0_17
LBB0_11:
	andl	$-4096, %eax                    ## imm = 0xF000
	andl	$4095, %r12d                    ## imm = 0xFFF
	orl	%eax, %r12d
	movl	%r12d, %eax
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PpcVirt2phys                   ; -- Begin function PpcVirt2phys
	.p2align	2
_PpcVirt2phys:                          ; @PpcVirt2phys
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
	bl	_GetMSR
	mov	w8, #32
	mov	w9, #16
	cmp	w21, #0
	csel	w8, w9, w8, eq
	tst	w0, w8
	b.eq	LBB0_8
; %bb.1:
	asr	w0, w19, #28
	bl	_GetSR
	mov	x20, x0
	tbnz	w0, #31, LBB0_7
; %bb.2:
	add	x2, sp, #12
	add	x3, sp, #8
	mov	w0, #0
	mov	x1, x21
	bl	_GetBat
	ldp	w1, w0, [sp, #8]
	mov	x2, x19
	bl	_BatHit
	cbnz	x0, LBB0_6
; %bb.3:
	add	x2, sp, #12
	add	x3, sp, #8
	mov	w0, #1
	mov	x1, x21
	bl	_GetBat
	ldp	w1, w0, [sp, #8]
	mov	x2, x19
	bl	_BatHit
	cbnz	x0, LBB0_6
; %bb.4:
	add	x2, sp, #12
	add	x3, sp, #8
	mov	w0, #2
	mov	x1, x21
	bl	_GetBat
	ldp	w1, w0, [sp, #8]
	mov	x2, x19
	bl	_BatHit
	cbnz	x0, LBB0_6
; %bb.5:
	add	x2, sp, #12
	add	x3, sp, #8
	mov	w0, #3
	mov	x1, x21
	bl	_GetBat
	ldp	w1, w0, [sp, #8]
	mov	x2, x19
	bl	_BatHit
	cbz	x0, LBB0_10
LBB0_6:
	ldp	w1, w0, [sp, #8]
	mov	x2, x19
	bl	_BatTranslate
	b	LBB0_9
LBB0_7:
	bfi	w19, w20, #28, #4
LBB0_8:
	mov	x0, x19
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	bl	_GetSDR1
	mov	w25, #0
	and	w24, w0, #0xffff0000
	mov	w26, #1023
	bfi	w26, w0, #10, #9
	and	w8, w20, #0x7ffff
	ubfx	w9, w19, #12, #16
	eor	w27, w8, w9
	lsr	w23, w19, #22
	and	w8, w27, w26
	add	w28, w24, w8, lsl #6
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w25, w25, #8
	cmp	w25, #64
	b.eq	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	add	w22, w28, w25
	mov	x0, x22
	bl	_GetPhys
	mov	x21, x0
	add	w0, w22, #4
	bl	_GetPhys
	tbnz	w21, #6, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	eor	w8, w20, w21, lsr #7
	and	w8, w8, #0xffffff
	cmp	w8, #0
	eor	w8, w21, w23
	and	w8, w8, #0x3f
	ccmp	w8, #0, #0, eq
	b.ne	LBB0_11
	b	LBB0_18
LBB0_14:
	mov	w25, #0
	bic	w8, w26, w27
	add	w24, w24, w8, lsl #6
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w25, w25, #8
	mov	w0, #-1
	cmp	w25, #64
	b.eq	LBB0_9
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	w22, w24, w25
	mov	x0, x22
	bl	_GetPhys
	mov	x21, x0
	add	w0, w22, #4
	bl	_GetPhys
	tbz	w21, #6, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	eor	w8, w20, w21, lsr #7
	and	w8, w8, #0xffffff
	cmp	w8, #0
	eor	w8, w21, w23
	and	w8, w8, #0x3f
	ccmp	w8, #0, #0, eq
	b.ne	LBB0_15
LBB0_18:
	bfxil	w0, w19, #0, #12
	b	LBB0_9
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
