	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bus_dmamap_count_ma
__bus_dmamap_count_ma:                  ## @_bus_dmamap_count_ma
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	cmpq	_nobounce_dmamap@GOTPCREL(%rip), %rsi
	je	LBB0_8
## %bb.1:
	movq	%rsi, %rbx
	cmpq	$0, (%rsi)
	je	LBB0_2
LBB0_8:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%ecx, %r13d
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	(%rax), %r14d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	12(%r15), %r12d
	movq	_Maxmem@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ptoa
	movl	(%r15), %r9d
	movl	8(%r15), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_CTR4
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %r8
	leaq	L_.str.1(%rip), %rsi
	movq	_nobounce_dmamap@GOTPCREL(%rip), %rcx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdx
	callq	_CTR3
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.3:
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	addl	%r12d, %r13d
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	notl	%ecx
	andl	%r13d, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %r15d
	andl	%eax, %r13d
	xorl	%edi, %edi
	cmpl	%r12d, %r14d
	setge	%dil
	leaq	L_.str.3(%rip), %rsi
	callq	_KASSERT
	subl	%r12d, %r14d
	jle	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%rax,8), %rdi
	callq	_VM_PAGE_TO_PHYS
	movslq	%r13d, %rcx
	addq	%rcx, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	subl	%ecx, %ebx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	4(%r12), %esi
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	callq	_MIN
	movl	%eax, %r14d
	movl	%ebx, %edi
	movq	%r12, %rbx
	movl	%eax, %esi
	callq	_MIN
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_bus_dma_run_filter
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %esi
	movl	%r12d, %edi
	callq	_roundup2
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_MIN
	movl	%eax, %r12d
	movl	(%rbx), %eax
	decl	%eax
	xorl	%edi, %edi
	testl	%r12d, %eax
	sete	%dil
	leaq	L_.str.2(%rip), %rsi
	callq	_KASSERT
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incq	(%rax)
	jmp	LBB0_6
LBB0_7:
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	leaq	L_.str.4(%rip), %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_CTR1                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_nobounce_dmamap,8,3            ## @nobounce_dmamap
	.comm	_KTR_BUSDMA,4,2                 ## @KTR_BUSDMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lowaddr= %d Maxmem= %d, boundary= %d, alignment= %d"

	.comm	_Maxmem,8,3                     ## @Maxmem
L_.str.1:                               ## @.str.1
	.asciz	"map= %p, nobouncemap= %p, pagesneeded= %d"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Segment size is not aligned"

	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
L_.str.3:                               ## @.str.3
	.asciz	"Segment length overruns original buffer"

L_.str.4:                               ## @.str.4
	.asciz	"pagesneeded= %d\n"

	.no_dead_strip	__bus_dmamap_count_ma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _bus_dmamap_count_ma
__bus_dmamap_count_ma:                  ; @_bus_dmamap_count_ma
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _nobounce_dmamap@GOTPAGE
Lloh1:
	ldr	x8, [x8, _nobounce_dmamap@GOTPAGEOFF]
	cmp	x1, x8
	b.eq	LBB0_2
; %bb.1:
	mov	x20, x1
	ldr	x8, [x1]
	cbz	x8, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x19, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x0
Lloh2:
	adrp	x26, _KTR_BUSDMA@GOTPAGE
Lloh3:
	ldr	x26, [x26, _KTR_BUSDMA@GOTPAGEOFF]
	ldr	w24, [x26]
	ldr	w25, [x0, #12]
Lloh4:
	adrp	x8, _Maxmem@GOTPAGE
Lloh5:
	ldr	x8, [x8, _Maxmem@GOTPAGEOFF]
Lloh6:
	ldr	x0, [x8]
	bl	_ptoa
	mov	x3, x0
	ldr	w4, [x22, #8]
	ldr	w5, [x22]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x25
	bl	_CTR4
	ldr	w0, [x26]
	ldr	x4, [x20]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh11:
	adrp	x3, _nobounce_dmamap@GOTPAGE
Lloh12:
	ldr	x3, [x3, _nobounce_dmamap@GOTPAGEOFF]
	mov	x2, x20
	bl	_CTR3
	cmp	w19, #1
	b.lt	LBB0_8
; %bb.4:
	mov	w25, #0
Lloh13:
	adrp	x24, l_.str.3@PAGE
Lloh14:
	add	x24, x24, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh15:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	add	w9, w26, w23
	and	w23, w9, w8
	bics	wzr, w9, w8
	cinc	w25, w25, ne
	subs	w19, w19, w26
	cset	w0, ge
	mov	x1, x24
	bl	_KASSERT
	cmp	w19, #0
	b.le	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21, w25, uxtw #3]
	bl	_VM_PAGE_TO_PHYS
	add	x28, x0, w23, sxtw
Lloh18:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	sub	w26, w8, w23
	ldr	w1, [x22, #4]
	mov	x0, x19
	bl	_MIN
	mov	x27, x0
	mov	x0, x26
	mov	x1, x27
	bl	_MIN
	mov	x26, x0
	mov	x0, x22
	mov	x1, x28
	bl	_bus_dma_run_filter
	cbz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x22]
	mov	x0, x26
	bl	_roundup2
	mov	x1, x27
	bl	_MIN
	mov	x26, x0
	ldr	w8, [x22]
	sub	w8, w8, #1
	tst	w8, w0
	cset	w0, eq
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x20]
	add	x8, x8, #1
	str	x8, [x20]
	b	LBB0_5
LBB0_8:
Lloh23:
	adrp	x8, _KTR_BUSDMA@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KTR_BUSDMA@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	ldr	x2, [x20]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_CTR1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_nobounce_dmamap,8,3            ; @nobounce_dmamap
	.comm	_KTR_BUSDMA,4,2                 ; @KTR_BUSDMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lowaddr= %d Maxmem= %d, boundary= %d, alignment= %d"

	.comm	_Maxmem,8,3                     ; @Maxmem
l_.str.1:                               ; @.str.1
	.asciz	"map= %p, nobouncemap= %p, pagesneeded= %d"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Segment size is not aligned"

	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
l_.str.3:                               ; @.str.3
	.asciz	"Segment length overruns original buffer"

l_.str.4:                               ; @.str.4
	.asciz	"pagesneeded= %d\n"

	.no_dead_strip	__bus_dmamap_count_ma
.subsections_via_symbols
