	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ps3fb_remap                    ## -- Begin function ps3fb_remap
	.p2align	4, 0x90
_ps3fb_remap:                           ## @ps3fb_remap
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_lv1_gpu_close
	xorl	%edi, %edi
	callq	_lv1_gpu_open
	movq	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_lv1_gpu_context_attribute
	movl	(%rbx), %esi
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_lv1_gpu_context_attribute
	movq	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_L1GPU_DISPLAY_SYNC_VSYNC@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_lv1_gpu_context_attribute
	movl	(%r14), %esi
	movl	(%rbx), %ecx
	xorl	%edi, %edi
	movl	$1, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_lv1_gpu_context_attribute
	movq	_ps3fb_softc@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movl	$1048576, %esi                  ## imm = 0x100000
	callq	_roundup2
	leaq	-40(%rbp), %rcx
	movq	%rcx, (%rsp)
	leaq	44(%r14), %r9
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_lv1_gpu_memory_allocate
	movl	44(%r14), %edi
	leaq	28(%r14), %rax
	movq	%rax, (%rsp)
	leaq	24(%r14), %rdx
	leaq	40(%r14), %rcx
	leaq	36(%r14), %r8
	leaq	32(%r14), %r9
	xorl	%esi, %esi
	callq	_lv1_gpu_context_allocate
	movl	24(%r14), %edi
	movq	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_lv1_gpu_context_attribute
	movl	24(%r14), %edi
	movl	(%rbx), %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_lv1_gpu_context_attribute
	movq	-40(%rbp), %rsi
	movq	%rsi, 16(%r14)
	cmpq	$0, (%r14)
	jle	LBB0_4
## %bb.1:
	movq	_VM_MEMATTR_WRITE_COMBINING@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	$268435456, %edi                ## imm = 0x10000000
	callq	_pmap_kenter_attr
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movq	(%r12), %rbx
	cmpq	(%r14), %rbx
	jge	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	268435456(%rbx), %rdi
	movq	-40(%rbp), %rsi
	addq	%rbx, %rsi
	movl	(%r15), %edx
	callq	_pmap_kenter_attr
	addq	(%r12), %rbx
	cmpq	(%r14), %rbx
	jl	LBB0_2
LBB0_4:
	movq	_FB_FLAG_NOWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%r14)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ps3fb_softc,48,3               ## @ps3fb_softc
	.comm	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET,4,2 ## @L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET
	.comm	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,4,2 ## @L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC
	.comm	_L1GPU_DISPLAY_SYNC_VSYNC,4,2   ## @L1GPU_DISPLAY_SYNC_VSYNC
	.comm	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP,4,2 ## @L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP
	.comm	_VM_MEMATTR_WRITE_COMBINING,4,2 ## @VM_MEMATTR_WRITE_COMBINING
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_FB_FLAG_NOWRITE,4,2            ## @FB_FLAG_NOWRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ps3fb_remap                    ; -- Begin function ps3fb_remap
	.p2align	2
_ps3fb_remap:                           ; @ps3fb_remap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	bl	_lv1_gpu_close
	mov	w0, #0
	bl	_lv1_gpu_open
Lloh0:
	adrp	x19, _L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET@GOTPAGE
Lloh1:
	ldr	x19, [x19, _L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET@GOTPAGEOFF]
	ldr	w1, [x19]
	mov	w0, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_lv1_gpu_context_attribute
	ldr	w1, [x19]
	mov	w0, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	bl	_lv1_gpu_context_attribute
Lloh2:
	adrp	x19, _L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC@GOTPAGE
Lloh3:
	ldr	x19, [x19, _L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC@GOTPAGEOFF]
	ldr	w1, [x19]
Lloh4:
	adrp	x20, _L1GPU_DISPLAY_SYNC_VSYNC@GOTPAGE
Lloh5:
	ldr	x20, [x20, _L1GPU_DISPLAY_SYNC_VSYNC@GOTPAGEOFF]
	ldr	w3, [x20]
	mov	w0, #0
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_lv1_gpu_context_attribute
	ldr	w1, [x19]
	ldr	w3, [x20]
	mov	w0, #0
	mov	w2, #1
	mov	w4, #0
	mov	w5, #0
	bl	_lv1_gpu_context_attribute
Lloh6:
	adrp	x19, _ps3fb_softc@GOTPAGE
Lloh7:
	ldr	x19, [x19, _ps3fb_softc@GOTPAGEOFF]
	ldr	x0, [x19]
	mov	w1, #1048576
	bl	_roundup2
	add	x5, x19, #44
	add	x6, sp, #8
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_lv1_gpu_memory_allocate
	ldr	w0, [x19, #44]
	add	x2, x19, #24
	add	x3, x19, #40
	add	x4, x19, #36
	add	x5, x19, #32
	add	x6, x19, #28
	mov	w1, #0
	bl	_lv1_gpu_context_allocate
	ldr	w0, [x19, #24]
Lloh8:
	adrp	x20, _L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP@GOTPAGE
Lloh9:
	ldr	x20, [x20, _L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_lv1_gpu_context_attribute
	ldr	w0, [x19, #24]
	ldr	w1, [x20]
	mov	w2, #1
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_lv1_gpu_context_attribute
	ldr	x1, [sp, #8]
	str	x1, [x19, #16]
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.1:
Lloh10:
	adrp	x20, _VM_MEMATTR_WRITE_COMBINING@GOTPAGE
Lloh11:
	ldr	x20, [x20, _VM_MEMATTR_WRITE_COMBINING@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	w0, #268435456
	bl	_pmap_kenter_attr
Lloh12:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x22, [x21]
	ldr	x8, [x19]
	cmp	x22, x8
	b.ge	LBB0_4
; %bb.2:
	mov	w23, #268435456
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #8]
	add	x0, x22, x23
	add	x1, x8, x22
	ldr	w2, [x20]
	bl	_pmap_kenter_attr
	ldr	x8, [x21]
	ldr	x9, [x19]
	add	x22, x8, x22
	cmp	x22, x9
	b.lt	LBB0_3
LBB0_4:
Lloh14:
	adrp	x8, _FB_FLAG_NOWRITE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FB_FLAG_NOWRITE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ps3fb_softc,48,3               ; @ps3fb_softc
	.comm	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET,4,2 ; @L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET
	.comm	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,4,2 ; @L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC
	.comm	_L1GPU_DISPLAY_SYNC_VSYNC,4,2   ; @L1GPU_DISPLAY_SYNC_VSYNC
	.comm	_L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP,4,2 ; @L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP
	.comm	_VM_MEMATTR_WRITE_COMBINING,4,2 ; @VM_MEMATTR_WRITE_COMBINING
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_FB_FLAG_NOWRITE,4,2            ; @FB_FLAG_NOWRITE
.subsections_via_symbols
