	.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
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	_DMAMAP_COULD_BOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_11
## %bb.1:
	cmpq	$0, 8(%rsi)
	je	LBB0_2
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rcx, %rbx
	movq	%rdx, %r12
	movq	%rdi, %r13
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movq	%rsi, %r15
	movl	(%rax), %r14d
	movl	8(%rdi), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_Maxmem@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ptoa
	movl	(%r13), %r9d
	movl	4(%r13), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%eax, %ecx
	callq	_CTR4
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r15), %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdx
	callq	_CTR2
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	jle	LBB0_10
## %bb.3:
	addq	%rbx, -56(%rbp)                 ## 8-byte Folded Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	%r14, %rbx
	cmpq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	jge	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	andq	%rbx, %r15
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_pmap_kextract
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_pmap_extract
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %esi
	subq	%r15, %r14
	movq	%r13, %rdi
	callq	_bus_dma_run_filter
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_roundup2
	movq	%rax, %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incq	8(%rax)
	jmp	LBB0_9
LBB0_10:
	movq	_KTR_BUSDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdx
	leaq	L_.str.2(%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	_DMAMAP_COULD_BOUNCE,4,2        ## @DMAMAP_COULD_BOUNCE
	.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, pagesneeded= %d"

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

	.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	w8, [x1]
Lloh0:
	adrp	x9, _DMAMAP_COULD_BOUNCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAMAP_COULD_BOUNCE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x19, x1
	ldr	x8, [x1, #8]
	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	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x0
Lloh3:
	adrp	x26, _KTR_BUSDMA@GOTPAGE
Lloh4:
	ldr	x26, [x26, _KTR_BUSDMA@GOTPAGEOFF]
	ldr	w24, [x26]
	ldr	w25, [x0, #8]
Lloh5:
	adrp	x8, _Maxmem@GOTPAGE
Lloh6:
	ldr	x8, [x8, _Maxmem@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_ptoa
	mov	x3, x0
	ldp	w5, w4, [x22]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x25
	bl	_CTR4
	ldr	w0, [x26]
	ldr	x3, [x19, #8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_CTR2
	cmp	x23, #1
	b.lt	LBB0_11
; %bb.4:
	add	x24, x20, x23
Lloh12:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
Lloh14:
	adrp	x27, _PAGE_MASK@GOTPAGE
Lloh15:
	ldr	x27, [x27, _PAGE_MASK@GOTPAGEOFF]
Lloh16:
	adrp	x28, _kernel_pmap@GOTPAGE
Lloh17:
	ldr	x28, [x28, _kernel_pmap@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x20, x23, x20
	cmp	x20, x24
	b.ge	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	x9, [x27]
	and	x9, x9, x20
	sub	x23, x8, x9
	ldr	x8, [x28]
	cmp	x8, x21
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_pmap_kextract
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_pmap_extract
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x0
	mov	x0, x22
	bl	_bus_dma_run_filter
	cbz	x0, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x22]
	mov	x0, x23
	bl	_roundup2
	mov	x23, x0
	ldr	x8, [x19, #8]
	add	x8, x8, #1
	str	x8, [x19, #8]
	b	LBB0_5
LBB0_11:
	ldr	w0, [x26]
	ldr	x2, [x19, #8]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAMAP_COULD_BOUNCE,4,2        ; @DMAMAP_COULD_BOUNCE
	.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, pagesneeded= %d"

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

	.no_dead_strip	__bus_dmamap_count_pages
.subsections_via_symbols
