	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bus_dmamap_count_pages
__bus_dmamap_count_pages:               ## @_bus_dmamap_count_pages
	.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
	cmpq	$0, (%rdx)
	je	LBB0_1
## %bb.10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rax
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	8(%rax), %edx
	movl	(%rax), %r8d
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %ecx
	movq	$0, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %r9
	callq	_CTR5
	testq	%r15, %r15
	jle	LBB0_9
## %bb.2:
	addq	%rbx, %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	%rbx, %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rbx
	subq	%rax, %rbx
	cmpq	%rbx, %r15
	jle	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	sete	%dil
	callq	___predict_true
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_pmap_kextract
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_pmap_extract
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r13d
	movq	%r15, %rdi
	subq	%rbx, %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	%rbx, %rax
	subq	%rax, %rsi
	callq	_min
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_must_bounce
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	(%r14)
	jmp	LBB0_8
LBB0_9:
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rdx
	leaq	L_.str.1(%rip), %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_CTR1                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_KTR_BUSDMA,4,2                 ## @KTR_BUSDMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lowaddr= %d, boundary= %d, alignment= %d map= %p, pagesneeded= %d"

	.comm	_kernel_pmap,8,3                ## @kernel_pmap
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
L_.str.1:                               ## @.str.1
	.asciz	"pagesneeded= %d"

	.no_dead_strip	__bus_dmamap_count_pages
.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_pages
__bus_dmamap_count_pages:               ; @_bus_dmamap_count_pages
	.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
	ldr	x8, [x2]
	cbz	x8, LBB0_2
; %bb.1:
	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_2:
	mov	x23, x4
	mov	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x24, _KTR_BUSDMA@GOTPAGE
Lloh1:
	ldr	x24, [x24, _KTR_BUSDMA@GOTPAGEOFF]
	ldr	w0, [x24]
	ldp	w3, w2, [x22, #4]
	ldr	w4, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x5, x19
	mov	x6, #0
	bl	_CTR5
	cmp	x23, #1
	b.lt	LBB0_10
; %bb.3:
	add	x25, x20, x23
Lloh4:
	adrp	x26, _kernel_pmap@GOTPAGE
Lloh5:
	ldr	x26, [x26, _kernel_pmap@GOTPAGEOFF]
Lloh6:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	adrp	x28, _PAGE_MASK@GOTPAGE
Lloh9:
	ldr	x28, [x28, _PAGE_MASK@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x27]
	ldr	x9, [x28]
	and	x9, x9, x20
	add	x8, x8, x20
	sub	x20, x8, x9
	cmp	x25, x20
	b.le	LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	cmp	x8, x21
	cset	w0, eq
	bl	___predict_true
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_pmap_kextract
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_pmap_extract
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
	sub	x0, x25, x20
	ldr	x8, [x27]
	ldr	x9, [x28]
	and	x9, x9, x20
	sub	x1, x8, x9
	bl	_min
	mov	x3, x0
	mov	x0, x22
	mov	x1, x19
	mov	x2, x23
	bl	_must_bounce
	cbz	x0, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	b	LBB0_4
LBB0_10:
	ldr	w0, [x24]
	ldr	x2, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_KTR_BUSDMA,4,2                 ; @KTR_BUSDMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lowaddr= %d, boundary= %d, alignment= %d map= %p, pagesneeded= %d"

	.comm	_kernel_pmap,8,3                ; @kernel_pmap
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
l_.str.1:                               ; @.str.1
	.asciz	"pagesneeded= %d"

	.no_dead_strip	__bus_dmamap_count_pages
.subsections_via_symbols
