	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l3remap
_l3remap:                               ## @l3remap
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_REMAP_MPUZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	orl	%esi, %ecx
	notl	%ebx
	andl	%eax, %ebx
	testl	%edx, %edx
	cmovnel	%ecx, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_OF_finddevice
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.2(%rip), %rsi
	leaq	-32(%rbp), %rdx
	movl	%eax, %edi
	movl	$4, %ecx
	callq	_OF_getencprop
	movl	$1, %r14d
	testq	%rax, %rax
	jle	LBB0_5
## %bb.3:
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	-32(%rbp), %esi
	leaq	-28(%rbp), %r8
	movl	$4, %edx
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movl	(%r15), %edi
	movl	-28(%rbp), %esi
	movq	_L3REGS_REMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %ecx
	callq	_bus_space_write_4
	xorl	%r14d, %r14d
	jmp	LBB0_5
LBB0_1:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_device_printf
	movl	$1, %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REMAP_MPUZERO,4,2              ## @REMAP_MPUZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"l3regs"

L_.str.1:                               ## @.str.1
	.asciz	"Can't find l3regs node\n"

L_.str.2:                               ## @.str.2
	.asciz	"reg"

	.comm	_fdtbus_bs_tag,4,2              ## @fdtbus_bs_tag
	.comm	_L3REGS_REMAP,4,2               ## @L3REGS_REMAP
	.no_dead_strip	_l3remap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l3remap
_l3remap:                               ; @l3remap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
Lloh0:
	adrp	x8, _REMAP_MPUZERO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REMAP_MPUZERO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w9, w8, w1
	bic	w8, w8, w1
	cmp	w2, #0
	csel	w19, w8, w9, eq
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_OF_finddevice
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.1:
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #12
	mov	w3, #4
	bl	_OF_getencprop
	cmp	x0, #1
	b.lt	LBB0_5
; %bb.2:
Lloh7:
	adrp	x20, _fdtbus_bs_tag@GOTPAGE
Lloh8:
	ldr	x20, [x20, _fdtbus_bs_tag@GOTPAGEOFF]
	ldr	w0, [x20]
	ldr	w1, [sp, #12]
	add	x4, sp, #8
	mov	w2, #4
	mov	w3, #0
	bl	_bus_space_map
	cbnz	x0, LBB0_5
; %bb.3:
	ldr	w0, [x20]
	ldr	w1, [sp, #8]
Lloh9:
	adrp	x8, _L3REGS_REMAP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _L3REGS_REMAP@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x3, x19
	bl	_bus_space_write_4
	mov	w0, #0
	b	LBB0_6
LBB0_4:
	ldr	w0, [x20]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
LBB0_5:
	mov	w0, #1
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_REMAP_MPUZERO,4,2              ; @REMAP_MPUZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"l3regs"

l_.str.1:                               ; @.str.1
	.asciz	"Can't find l3regs node\n"

l_.str.2:                               ; @.str.2
	.asciz	"reg"

	.comm	_fdtbus_bs_tag,4,2              ; @fdtbus_bs_tag
	.comm	_L3REGS_REMAP,4,2               ; @L3REGS_REMAP
	.no_dead_strip	_l3remap
.subsections_via_symbols
