	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moea_bat_mapped
_moea_bat_mapped:                       ## @moea_bat_mapped
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_battable@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	%edi, %rdi
	movl	(%rcx,%rdi,8), %r8d
	movq	_BAT_Vs@GOTPCREL(%rip), %rax
	testl	%r8d, (%rax)
	je	LBB0_1
## %bb.2:
	movl	4(%rcx,%rdi,8), %ecx
	movq	_BAT_I@GOTPCREL(%rip), %rax
	movq	_BAT_G@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	orl	(%rax), %edi
	movq	_BAT_PP_RW@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%ecx, %eax
	notl	%eax
	testl	%eax, %edi
	jne	LBB0_3
## %bb.4:
	movq	_BAT_PBS@GOTPCREL(%rip), %rax
	andl	(%rax), %ecx
	cmpl	%esi, %ecx
	jg	LBB0_6
## %bb.5:
	movq	_BAT_EBS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %r8d
	shll	$15, %r8d
	orl	%r8d, %ecx
	orl	$131071, %ecx                   ## imm = 0x1FFFF
	addl	%esi, %edx
	xorl	%eax, %eax
	cmpl	%ecx, %edx
	jle	LBB0_8
LBB0_6:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
LBB0_8:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_battable,8,3                   ## @battable
	.comm	_BAT_Vs,4,2                     ## @BAT_Vs
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BAT_I,4,2                      ## @BAT_I
	.comm	_BAT_G,4,2                      ## @BAT_G
	.comm	_BAT_PP_RW,4,2                  ## @BAT_PP_RW
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_BAT_PBS,4,2                    ## @BAT_PBS
	.comm	_BAT_EBS,4,2                    ## @BAT_EBS
	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_moea_bat_mapped
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moea_bat_mapped
_moea_bat_mapped:                       ; @moea_bat_mapped
	.cfi_startproc
; %bb.0:
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x8, _battable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _battable@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
	sbfiz	x8, x0, #3, #32
	ldr	w8, [x9, x8]
Lloh3:
	adrp	x10, _BAT_Vs@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BAT_Vs@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_5
; %bb.1:
	sxtw	x10, w0
	add	x9, x9, x10, lsl #3
	ldr	w9, [x9, #4]
Lloh6:
	adrp	x10, _BAT_I@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BAT_I@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
Lloh9:
	adrp	x11, _BAT_G@GOTPAGE
Lloh10:
	ldr	x11, [x11, _BAT_G@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh12:
	adrp	x11, _BAT_PP_RW@GOTPAGE
Lloh13:
	ldr	x11, [x11, _BAT_PP_RW@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	orr	w10, w10, w11
	bics	wzr, w10, w9
	b.ne	LBB0_6
; %bb.2:
Lloh15:
	adrp	x10, _BAT_PBS@GOTPAGE
Lloh16:
	ldr	x10, [x10, _BAT_PBS@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	and	w9, w10, w9
	cmp	w9, w1
	b.gt	LBB0_4
; %bb.3:
Lloh18:
	adrp	x10, _BAT_EBS@GOTPAGE
Lloh19:
	ldr	x10, [x10, _BAT_EBS@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	bic	w8, w8, w10
	orr	w8, w9, w8, lsl #15
	orr	w8, w8, #0x1ffff
	add	w9, w2, w1
	cmp	w9, w8
	b.le	LBB0_7
LBB0_4:
Lloh21:
	adrp	x8, _ERANGE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ret
LBB0_5:
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ret
LBB0_6:
Lloh27:
	adrp	x8, _EPERM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ret
LBB0_7:
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_battable,8,3                   ; @battable
	.comm	_BAT_Vs,4,2                     ; @BAT_Vs
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BAT_I,4,2                      ; @BAT_I
	.comm	_BAT_G,4,2                      ; @BAT_G
	.comm	_BAT_PP_RW,4,2                  ; @BAT_PP_RW
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_BAT_PBS,4,2                    ; @BAT_PBS
	.comm	_BAT_EBS,4,2                    ; @BAT_EBS
	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_moea_bat_mapped
.subsections_via_symbols
