	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4c_lockarea
_sun4c_lockarea:                        ## @sun4c_lockarea
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	andq	%rdi, %rax
	addq	%rsi, %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rcx,%rax), %r12
	decq	%r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %r12
	callq	_local_irq_save
	movq	_sun4c_iobuffer_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_iobuffer_map_size@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	xorl	%edx, %edx
	callq	_find_next_zero_bit
	leaq	(%rax,%r12), %r14
	cmpq	(%r13), %r14
	ja	LBB0_2
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpq	%r14, %rax
	jae	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_sun4c_iobuffer_map@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_6
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_sun4c_iobuffer_map@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r13), %rsi
	movq	%rbx, %rdx
	callq	_find_next_zero_bit
	movq	%rax, %r14
	addq	%r12, %r14
	cmpq	(%r13), %r14
	jbe	LBB0_4
LBB0_2:
	callq	_local_irq_restore
	leaq	L_.str(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_printk
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_8:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	movq	%r14, %rdi
	shlq	%cl, %rdi
	movq	_sun4c_iobuffer_start@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_SUN4C_REAL_PGDIR_ALIGN
	movq	_sun4c_iobuffer_high@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	cmpq	%rdi, %rax
	jbe	LBB0_11
## %bb.9:
	movq	%rax, %rbx
	movq	_SUN4C_REAL_PGDIR_SIZE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	callq	_get_locked_segment
	movq	(%r15), %rdi
	addq	(%r12), %rdi
	movq	%rdi, (%r15)
	cmpq	%rdi, %rbx
	ja	LBB0_10
LBB0_11:
	cmpq	%r14, -48(%rbp)                 ## 8-byte Folded Reload
	jae	LBB0_14
## %bb.12:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	andq	-56(%rbp), %r15                 ## 8-byte Folded Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rbx
	movq	_PAGE_OFFSET@GOTPCREL(%rip), %rax
	subq	(%rax), %rbx
	movzbl	(%r13), %ecx
	shrq	%cl, %rbx
	movq	_SUN4C_PAGE_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_pgprot_val
	orq	%rax, %rbx
	movq	__SUN4C_PAGE_NOCACHE@GOTPCREL(%rip), %rax
	orq	(%rax), %rbx
	movq	_sun4c_iobuffer_map@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_set_bit
	movzbl	(%r13), %ecx
	movq	%r12, %r13
	shlq	%cl, %r13
	movq	_sun4c_iobuffer_start@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	movq	%r15, %rdi
	callq	_sun4c_flush_page
	movq	%r13, %rdi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r13
	movq	%rbx, %rsi
	callq	_sun4c_put_pte
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	%rax, %r15
	incq	%r12
	cmpq	%r12, %r14
	jne	LBB0_13
LBB0_14:
	callq	_local_irq_restore
	movb	(%r13), %cl
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	shlq	%cl, %rdx
	movq	_sun4c_iobuffer_start@GOTPCREL(%rip), %rax
	addq	(%rax), %rdx
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	andq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	addq	%rdx, %rax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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_map,4,2         ## @sun4c_iobuffer_map
	.comm	_iobuffer_map_size,8,3          ## @iobuffer_map_size
	.comm	_sun4c_iobuffer_start,8,3       ## @sun4c_iobuffer_start
	.comm	_sun4c_iobuffer_high,8,3        ## @sun4c_iobuffer_high
	.comm	_SUN4C_REAL_PGDIR_SIZE,8,3      ## @SUN4C_REAL_PGDIR_SIZE
	.comm	_PAGE_OFFSET,8,3                ## @PAGE_OFFSET
	.comm	_SUN4C_PAGE_KERNEL,4,2          ## @SUN4C_PAGE_KERNEL
	.comm	__SUN4C_PAGE_NOCACHE,8,3        ## @_SUN4C_PAGE_NOCACHE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA vaddr=0x%p size=%08lx\n"

L_.str.1:                               ## @.str.1
	.asciz	"Out of iobuffer table"

	.no_dead_strip	_sun4c_lockarea
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4c_lockarea
_sun4c_lockarea:                        ; @sun4c_lockarea
	.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	x20, x0
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	bic	x8, x0, x8
Lloh3:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldrsw	x9, [x24]
	add	x8, x8, x1
	add	x8, x9, x8
	sub	x8, x8, #1
Lloh5:
	adrp	x26, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x26, [x26, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x9, [x26]
	lsr	x19, x8, x9
	bl	_local_irq_save
Lloh7:
	adrp	x28, _sun4c_iobuffer_map@GOTPAGE
Lloh8:
	ldr	x28, [x28, _sun4c_iobuffer_map@GOTPAGEOFF]
	ldr	w0, [x28]
Lloh9:
	adrp	x23, _iobuffer_map_size@GOTPAGE
Lloh10:
	ldr	x23, [x23, _iobuffer_map_size@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	x2, #0
	bl	_find_next_zero_bit
	ldr	x8, [x23]
	add	x25, x0, x19
	cmp	x25, x8
	b.ls	LBB0_2
LBB0_1:
	bl	_local_irq_restore
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_printk
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
	mov	x0, #0
	b	LBB0_15
LBB0_2:
	mov	x27, x0
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	x27, x25
	b.hs	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x27
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x28]
	mov	x0, x22
	bl	_test_bit
	cbnz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x22, x22, #1
	cmp	x25, x22
	b.ne	LBB0_5
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x28]
	ldr	x1, [x23]
	mov	x2, x22
	bl	_find_next_zero_bit
	mov	x27, x0
	ldr	x8, [x23]
	add	x25, x0, x19
	cmp	x25, x8
	b.ls	LBB0_3
	b	LBB0_1
LBB0_8:
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x8, [x26]
	lsl	x8, x25, x8
Lloh15:
	adrp	x9, _sun4c_iobuffer_start@GOTPAGE
Lloh16:
	ldr	x9, [x9, _sun4c_iobuffer_start@GOTPAGEOFF]
	mov	x22, x9
	ldr	x9, [x9]
	add	x0, x8, x9
	bl	_SUN4C_REAL_PGDIR_ALIGN
	mov	x21, x0
Lloh17:
	adrp	x19, _sun4c_iobuffer_high@GOTPAGE
Lloh18:
	ldr	x19, [x19, _sun4c_iobuffer_high@GOTPAGEOFF]
	ldr	x0, [x19]
	cmp	x21, x0
	b.ls	LBB0_11
; %bb.9:
Lloh19:
	adrp	x20, _SUN4C_REAL_PGDIR_SIZE@GOTPAGE
Lloh20:
	ldr	x20, [x20, _SUN4C_REAL_PGDIR_SIZE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	bl	_get_locked_segment
	ldr	x8, [x20]
	ldr	x9, [x19]
	add	x0, x9, x8
	cmp	x21, x0
	str	x0, [x19]
	b.hi	LBB0_10
LBB0_11:
	str	x27, [sp]                       ; 8-byte Folded Spill
	cmp	x27, x25
	mov	x19, x22
	b.hs	LBB0_14
; %bb.12:
Lloh21:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	ldp	x22, x9, [sp]                   ; 16-byte Folded Reload
	and	x21, x8, x9
Lloh24:
	adrp	x20, __SUN4C_PAGE_NOCACHE@GOTPAGE
Lloh25:
	ldr	x20, [x20, __SUN4C_PAGE_NOCACHE@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
Lloh26:
	adrp	x8, _PAGE_OFFSET@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PAGE_OFFSET@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	sub	x8, x21, x8
	ldr	x9, [x26]
	lsr	x23, x8, x9
Lloh29:
	adrp	x8, _SUN4C_PAGE_KERNEL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SUN4C_PAGE_KERNEL@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	bl	_pgprot_val
	orr	x8, x0, x23
	ldr	x9, [x20]
	orr	x23, x8, x9
	ldr	w1, [x28]
	mov	x0, x22
	bl	_set_bit
	ldr	x8, [x26]
	lsl	x8, x22, x8
	ldr	x9, [x19]
	mov	x27, x26
	mov	x26, x24
	add	x24, x8, x9
	mov	x0, x21
	bl	_sun4c_flush_page
	mov	x0, x24
	mov	x24, x26
	mov	x26, x27
	mov	x1, x23
	bl	_sun4c_put_pte
	ldrsw	x8, [x24]
	add	x21, x21, x8
	add	x22, x22, #1
	cmp	x25, x22
	b.ne	LBB0_13
LBB0_14:
	bl	_local_irq_restore
	ldr	x8, [x26]
	ldp	x9, x11, [sp]                   ; 16-byte Folded Reload
	lsl	x8, x9, x8
	ldr	x9, [x19]
Lloh32:
	adrp	x10, _PAGE_MASK@GOTPAGE
Lloh33:
	ldr	x10, [x10, _PAGE_MASK@GOTPAGEOFF]
Lloh34:
	ldr	x10, [x10]
	bic	x10, x11, x10
	add	x8, x8, x9
	add	x0, x8, x10
LBB0_15:
	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
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.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_map,4,2         ; @sun4c_iobuffer_map
	.comm	_iobuffer_map_size,8,3          ; @iobuffer_map_size
	.comm	_sun4c_iobuffer_start,8,3       ; @sun4c_iobuffer_start
	.comm	_sun4c_iobuffer_high,8,3        ; @sun4c_iobuffer_high
	.comm	_SUN4C_REAL_PGDIR_SIZE,8,3      ; @SUN4C_REAL_PGDIR_SIZE
	.comm	_PAGE_OFFSET,8,3                ; @PAGE_OFFSET
	.comm	_SUN4C_PAGE_KERNEL,4,2          ; @SUN4C_PAGE_KERNEL
	.comm	__SUN4C_PAGE_NOCACHE,8,3        ; @_SUN4C_PAGE_NOCACHE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA vaddr=0x%p size=%08lx\n"

l_.str.1:                               ; @.str.1
	.asciz	"Out of iobuffer table"

	.no_dead_strip	_sun4c_lockarea
.subsections_via_symbols
