	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bounce_bus_dmamap_load_ma
_bounce_bus_dmamap_load_ma:             ## @bounce_bus_dmamap_load_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movl	%r8d, %r14d
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	_BUS_DMA_KEEP_PG_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rdi)
	je	LBB0_1
## %bb.24:
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	movl	%r15d, %r9d
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bus_dmamap_load_ma_triv        ## TAILCALL
LBB0_1:
	movq	16(%rbp), %rax
	testq	%r12, %r12
	jne	LBB0_3
## %bb.2:
	movq	_nobounce_dmamap@GOTPCREL(%rip), %r12
LBB0_3:
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	16(%rdi), %rax
LBB0_5:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	24(%rbp), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	_BUS_DMA_COULD_BOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.6:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	movl	%r15d, %r9d
	callq	__bus_dmamap_count_ma
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	cmpq	$0, (%r12)
	je	LBB0_8
## %bb.7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	__bus_dmamap_reserve_pages
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	testl	%eax, %eax
	jne	LBB0_23
LBB0_8:
	testl	%r13d, %r13d
	jle	LBB0_20
## %bb.9:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	leaq	4(%rdi), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movl	%ecx, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	(%rbx,%rax,8), %rdi
	callq	_VM_PAGE_TO_PHYS
	movq	%rax, %r15
	movslq	%r14d, %rbx
	addq	%rbx, %r15
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	8(%r12), %esi
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, %edi
	callq	_MIN
	movl	%eax, %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	subl	%ebx, %r13d
	movq	_BUS_DMA_COULD_BOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%esi, %ebx
	movq	%r15, %rsi
	callq	_bus_dma_run_filter
	movl	%ebx, %esi
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%esi, %ebx
	movl	12(%r12), %esi
	movl	%r13d, %edi
	callq	_roundup2
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_MIN
	movl	%eax, %ebx
	movl	12(%r12), %eax
	decl	%eax
	xorl	%edi, %edi
	testl	%ebx, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	leal	(%rbx,%r14), %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rax,%rcx,8), %rdi
	callq	_VM_PAGE_TO_PHYS
	movq	%rax, %r8
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%r13d, %edi
	callq	_MIN
	movl	%eax, %ebx
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	xorl	%r8d, %r8d
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	movq	%r15, %rcx
	movl	%ebx, %r9d
	callq	_add_bounce_page
	movq	%r12, %rdi
	movq	%rax, %r15
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movq	-104(%rbp), %r9                 ## 8-byte Reload
	callq	__bus_dmamap_addseg
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	%eax, %r13d
	setge	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	addl	%ebx, %r14d
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	notl	%ecx
	andl	%r14d, %ecx
	cmpl	$1, %ecx
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	sbbl	$-1, %ecx
	andl	%eax, %r14d
	subl	%ebx, %r13d
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jg	LBB0_10
LBB0_20:
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.21:
	movq	_EFBIG@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_22:
	movl	%r13d, %eax
LBB0_23:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUS_DMA_KEEP_PG_OFFSET,4,2     ## @BUS_DMA_KEEP_PG_OFFSET
	.comm	_nobounce_dmamap,8,3            ## @nobounce_dmamap
	.comm	_BUS_DMA_COULD_BOUNCE,4,2       ## @BUS_DMA_COULD_BOUNCE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Segment size is not aligned"

L_.str.1:                               ## @.str.1
	.asciz	"Segment length overruns original buffer"

	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_EFBIG,4,2                      ## @EFBIG
	.no_dead_strip	_bounce_bus_dmamap_load_ma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bounce_bus_dmamap_load_ma
_bounce_bus_dmamap_load_ma:             ; @bounce_bus_dmamap_load_ma
	.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	x28, x7
	mov	x20, x6
	mov	x27, x5
	mov	x22, x4
	mov	x19, x3
	mov	x23, x2
	mov	x24, x0
	mov	x21, x0
	ldr	w8, [x21, #4]!
Lloh0:
	adrp	x9, _BUS_DMA_KEEP_PG_OFFSET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BUS_DMA_KEEP_PG_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x24
	mov	x2, x23
	mov	x3, x19
	mov	x4, x22
	mov	x5, x27
	mov	x6, x20
	mov	x7, x28
	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
	b	_bus_dmamap_load_ma_triv
LBB0_2:
Lloh3:
	adrp	x8, _nobounce_dmamap@GOTPAGE
Lloh4:
	ldr	x8, [x8, _nobounce_dmamap@GOTPAGEOFF]
	cmp	x1, #0
	csel	x26, x8, x1, eq
	cbnz	x20, LBB0_4
; %bb.3:
	ldr	x20, [x24, #16]
LBB0_4:
	ldr	w8, [x24]
Lloh5:
	adrp	x9, _BUS_DMA_COULD_BOUNCE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BUS_DMA_COULD_BOUNCE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	mov	x0, x24
	mov	x1, x26
	mov	x2, x23
	mov	x3, x22
	mov	x4, x19
	mov	x5, x27
	bl	__bus_dmamap_count_ma
	ldr	x8, [x26]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x24
	mov	x1, x26
	mov	x2, x27
	bl	__bus_dmamap_reserve_pages
	cbnz	w0, LBB0_20
LBB0_7:
	cmp	w19, #1
	b.lt	LBB0_19
; %bb.8:
	stp	x21, x20, [sp]                  ; 16-byte Folded Spill
	mov	w20, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x21, x28
	ldr	x0, [x23, w20, uxtw #3]
	bl	_VM_PAGE_TO_PHYS
	add	x28, x0, w22, sxtw
	ldr	w1, [x24, #8]
	mov	x0, x19
	bl	_MIN
	mov	x27, x0
Lloh8:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	sub	w25, w8, w22
	ldr	w8, [x24]
Lloh11:
	adrp	x9, _BUS_DMA_COULD_BOUNCE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BUS_DMA_COULD_BOUNCE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x26]
	cbz	x8, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x1, x28
	bl	_bus_dma_run_filter
	cbz	x0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x24, #12]
	mov	x0, x25
	bl	_roundup2
	mov	x1, x27
	bl	_MIN
	mov	x27, x0
	ldr	w8, [x24, #12]
	sub	w8, w8, #1
	tst	w8, w0
	cset	w0, eq
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh16:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	add	w9, w27, w22
	cmp	w9, w8
	b.le	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w8, w20, #1
	ldr	x0, [x23, w8, uxtw #3]
	bl	_VM_PAGE_TO_PHYS
	mov	x4, x0
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x25
	mov	x1, x27
	bl	_MIN
	mov	x27, x0
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x4, #0
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x24
	mov	x1, x26
	mov	w2, #0
	mov	x3, x28
	mov	x5, x27
	bl	_add_bounce_page
	mov	x28, x0
LBB0_17:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	mov	x1, x26
	mov	x2, x28
	mov	x3, x27
	mov	x4, x25
	mov	x28, x21
	mov	x5, x21
	bl	__bus_dmamap_addseg
	cbz	w0, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x25, x0
	subs	w19, w19, w0
	cset	w0, ge
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
Lloh21:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	add	w9, w25, w22
	and	w22, w8, w9
	bics	wzr, w9, w8
	cinc	w20, w20, ne
	cmp	w19, #0
	b.gt	LBB0_9
LBB0_19:
Lloh24:
	adrp	x8, _EFBIG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EFBIG@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w19, #0
	csel	w0, wzr, w8, eq
LBB0_20:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_BUS_DMA_KEEP_PG_OFFSET,4,2     ; @BUS_DMA_KEEP_PG_OFFSET
	.comm	_nobounce_dmamap,8,3            ; @nobounce_dmamap
	.comm	_BUS_DMA_COULD_BOUNCE,4,2       ; @BUS_DMA_COULD_BOUNCE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Segment size is not aligned"

l_.str.1:                               ; @.str.1
	.asciz	"Segment length overruns original buffer"

	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_EFBIG,4,2                      ; @EFBIG
	.no_dead_strip	_bounce_bus_dmamap_load_ma
.subsections_via_symbols
