	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4c_unlockarea
_sun4c_unlockarea:                      ## @sun4c_unlockarea
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rax
	notq	%rax
	andq	%rdi, %rax
	addq	%rsi, %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movslq	(%r12), %rcx
	leaq	(%rcx,%rax), %r13
	decq	%r13
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %r13
	callq	_local_irq_save
	testq	%r13, %r13
	je	LBB0_3
## %bb.1:
	andq	%r14, %rbx
	movq	_sun4c_iobuffer_start@GOTPCREL(%rip), %r14
	movq	_sun4c_iobuffer_map@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_sun4c_put_pte
	movq	%rbx, %rdi
	subq	(%r14), %rdi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	shrq	%cl, %rdi
	movq	(%r15), %rsi
	callq	_clear_bit
	movslq	(%r12), %rax
	addq	%rax, %rbx
	decq	%r13
	jne	LBB0_2
LBB0_3:
	movq	_sun4c_iobuffer_high@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_sun4c_iobuffer_start@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	subq	%rdi, %rax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shrq	%cl, %rax
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	movq	_sun4c_iobuffer_map@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %edx
	shrl	$5, %edx
	cmpl	$0, (%rsi,%rdx,4)
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	-32(%rax), %edx
	cmpl	$31, %eax
	movl	%edx, %eax
	jg	LBB0_5
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %edx
LBB0_9:
	addl	$32, %edx
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %edx
	addl	%edx, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_SUN4C_REAL_PGDIR_ALIGN
	movq	_SUN4C_REAL_PGDIR_SIZE@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	addl	%ecx, %eax
	movslq	%eax, %rbx
	movq	(%r12), %rdi
	cmpq	%rdi, %rbx
	jae	LBB0_13
## %bb.10:
	subq	%rcx, %rdi
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%rdi, (%r12)
	callq	_free_locked_segment
	movq	(%r12), %rdi
	cmpq	%rdi, %rbx
	jae	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	subq	(%r14), %rdi
	jmp	LBB0_11
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_local_irq_restore              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_sun4c_iobuffer_start,8,3       ## @sun4c_iobuffer_start
	.comm	_sun4c_iobuffer_map,8,3         ## @sun4c_iobuffer_map
	.comm	_sun4c_iobuffer_high,8,3        ## @sun4c_iobuffer_high
	.comm	_SUN4C_REAL_PGDIR_SIZE,8,3      ## @SUN4C_REAL_PGDIR_SIZE
	.no_dead_strip	_sun4c_unlockarea
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4c_unlockarea
_sun4c_unlockarea:                      ; @sun4c_unlockarea
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	bic	x8, x0, x25
Lloh3:
	adrp	x22, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PAGE_SIZE@GOTPAGEOFF]
	ldrsw	x9, [x22]
	add	x8, x8, x1
	add	x8, x9, x8
	sub	x8, x8, #1
Lloh5:
	adrp	x20, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x20, [x20, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x9, [x20]
	lsr	x23, x8, x9
	bl	_local_irq_save
Lloh7:
	adrp	x24, _sun4c_iobuffer_start@GOTPAGE
Lloh8:
	ldr	x24, [x24, _sun4c_iobuffer_start@GOTPAGEOFF]
Lloh9:
	adrp	x21, _sun4c_iobuffer_map@GOTPAGE
Lloh10:
	ldr	x21, [x21, _sun4c_iobuffer_map@GOTPAGEOFF]
	cbz	x23, LBB0_3
; %bb.1:
	and	x19, x25, x19
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	x23, x23, #1
	mov	x0, x19
	mov	w1, #0
	bl	_sun4c_put_pte
	ldr	x8, [x24]
	sub	x8, x19, x8
	ldr	x9, [x20]
	lsr	x0, x8, x9
	ldr	x1, [x21]
	bl	_clear_bit
	ldrsw	x8, [x22]
	add	x19, x19, x8
	cbnz	x23, LBB0_2
LBB0_3:
Lloh11:
	adrp	x19, _sun4c_iobuffer_high@GOTPAGE
Lloh12:
	ldr	x19, [x19, _sun4c_iobuffer_high@GOTPAGEOFF]
	ldr	x9, [x19]
	ldr	x8, [x24]
	sub	x10, x9, x8
	ldr	x9, [x20]
	lsr	x10, x10, x9
	tbnz	w10, #31, LBB0_7
; %bb.4:
	ldr	x11, [x21]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w12, w10, #5
	ldr	w12, [x11, w12, uxtw #2]
	cbnz	w12, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w12, w10, #32
	cmp	w10, #31
	mov	x10, x12
	b.gt	LBB0_5
	b	LBB0_8
LBB0_7:
	mov	x12, x10
LBB0_8:
	add	w10, w12, #32
	lsl	w9, w10, w9
	add	w0, w9, w8
	bl	_SUN4C_REAL_PGDIR_ALIGN
Lloh13:
	adrp	x20, _SUN4C_REAL_PGDIR_SIZE@GOTPAGE
Lloh14:
	ldr	x20, [x20, _SUN4C_REAL_PGDIR_SIZE@GOTPAGEOFF]
	ldr	x8, [x20]
	add	w9, w8, w0
	sxtw	x21, w9
	ldr	x9, [x19]
	cmp	x21, x9
	b.hs	LBB0_12
; %bb.9:
	sub	x0, x9, x8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	str	x0, [x19]
	bl	_free_locked_segment
	ldr	x8, [x19]
	cmp	x21, x8
	b.hs	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [x20]
	sub	x0, x8, x9
	b	LBB0_10
LBB0_12:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_local_irq_restore
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_sun4c_iobuffer_start,8,3       ; @sun4c_iobuffer_start
	.comm	_sun4c_iobuffer_map,8,3         ; @sun4c_iobuffer_map
	.comm	_sun4c_iobuffer_high,8,3        ; @sun4c_iobuffer_high
	.comm	_SUN4C_REAL_PGDIR_SIZE,8,3      ; @SUN4C_REAL_PGDIR_SIZE
	.no_dead_strip	_sun4c_unlockarea
.subsections_via_symbols
