	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bounce_bus_dmamap_load_buffer
_bounce_bus_dmamap_load_buffer:         ## @bounce_bus_dmamap_load_buffer
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rdi, %r12
	movq	16(%rbp), %rcx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	jne	LBB0_2
## %bb.1:
	movq	_nobounce_dmamap@GOTPCREL(%rip), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_2:
	testq	%rcx, %rcx
	jne	LBB0_4
## %bb.3:
	movq	24(%r12), %rcx
LBB0_4:
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_BUS_DMA_COULD_BOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_7
## %bb.5:
	movq	%r12, %r14
	movq	%r12, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movq	%r13, %rcx
	movq	%rbx, %r8
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movl	-56(%rbp), %r9d                 ## 4-byte Reload
	callq	__bus_dmamap_count_pages
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	__bus_dmamap_reserve_pages
	testl	%eax, %eax
	jne	LBB0_21
LBB0_7:
	testq	%rbx, %rbx
	jle	LBB0_19
## %bb.8:
	leaq	8(%r12), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	callq	_pmap_kextract
	movl	%eax, %r14d
	movq	%r13, %rax
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_pmap_extract
	movl	%eax, %r14d
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r12), %rsi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_MIN
	movq	%rax, %rbx
	movq	%r12, %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	cltq
	subq	%rax, %r12
	movq	_BUS_DMA_COULD_BOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rcx, %r15
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	callq	_bus_dma_run_filter
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	16(%r15), %esi
	movq	%r12, %rdi
	callq	_roundup2
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_MIN
	movq	%rax, %r12
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	movq	%rax, %r9
	callq	_add_bounce_page
	movl	%eax, %r14d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_MIN
	movq	%rax, %r12
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	movq	%r12, %rcx
	movq	24(%rbp), %r9
	callq	__bus_dmamap_addseg
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %r12
	addq	%rax, %r13
	subq	%rax, %rbx
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	jg	LBB0_9
LBB0_19:
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	LBB0_21
## %bb.20:
	movq	_EFBIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_21:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nobounce_dmamap,8,3            ## @nobounce_dmamap
	.comm	_BUS_DMA_COULD_BOUNCE,4,2       ## @BUS_DMA_COULD_BOUNCE
	.comm	_kernel_pmap,8,3                ## @kernel_pmap
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_EFBIG,4,2                      ## @EFBIG
	.no_dead_strip	_bounce_bus_dmamap_load_buffer
.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_buffer
_bounce_bus_dmamap_load_buffer:         ; @bounce_bus_dmamap_load_buffer
	.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
	str	x7, [sp, #8]                    ; 8-byte Folded Spill
	mov	x21, x6
	mov	x26, x5
	mov	x22, x4
	mov	x19, x3
	mov	x23, x2
	mov	x24, x0
Lloh0:
	adrp	x8, _nobounce_dmamap@GOTPAGE
Lloh1:
	ldr	x8, [x8, _nobounce_dmamap@GOTPAGEOFF]
	cmp	x1, #0
	csel	x25, x8, x1, eq
	cbnz	x6, LBB0_2
; %bb.1:
	ldr	x21, [x24, #24]
LBB0_2:
	ldr	w8, [x24]
Lloh2:
	adrp	x9, _BUS_DMA_COULD_BOUNCE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BUS_DMA_COULD_BOUNCE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	mov	x0, x24
	mov	x1, x25
	mov	x2, x22
	mov	x3, x23
	mov	x4, x19
	mov	x5, x26
	bl	__bus_dmamap_count_pages
	ldr	x8, [x25]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x24
	mov	x1, x25
	mov	x2, x26
	bl	__bus_dmamap_reserve_pages
	cbnz	w0, LBB0_18
LBB0_5:
	cmp	x19, #1
	b.lt	LBB0_17
; %bb.6:
	add	x8, x24, #8
	str	x8, [sp]                        ; 8-byte Folded Spill
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
Lloh5:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh6:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_pmap_kextract
	mov	x27, x0
	mov	x28, x23
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_pmap_extract
	mov	x27, x0
	mov	x28, #0
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x1, [x24, #8]
	mov	x0, x19
	bl	_MIN
	mov	x26, x0
Lloh8:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _PAGE_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PAGE_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w9, w9, w27
	sub	x20, x8, w9, sxtw
	ldr	w8, [x24]
Lloh14:
	adrp	x9, _BUS_DMA_COULD_BOUNCE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BUS_DMA_COULD_BOUNCE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x25]
	cbz	x8, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x1, x27
	bl	_bus_dma_run_filter
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x24, #16]
	mov	x0, x20
	bl	_roundup2
	mov	x1, x26
	bl	_MIN
	mov	x26, x0
	mov	x0, x24
	mov	x1, x25
	mov	x2, x28
	mov	x3, x27
	mov	w4, #0
	mov	x5, x26
	bl	_add_bounce_page
	mov	x27, x0
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x26
	bl	_MIN
	mov	x26, x0
LBB0_15:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	mov	x1, x25
	mov	x2, x27
	mov	x3, x26
	mov	x4, x21
	ldr	x5, [sp, #8]                    ; 8-byte Folded Reload
	bl	__bus_dmamap_addseg
	cbz	x0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x23, x0, x23
	sub	x19, x19, x0
	cmp	x19, #0
	b.gt	LBB0_7
LBB0_17:
Lloh17:
	adrp	x8, _EFBIG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EFBIG@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	x19, #0
	csel	w0, wzr, w8, eq
LBB0_18:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_nobounce_dmamap,8,3            ; @nobounce_dmamap
	.comm	_BUS_DMA_COULD_BOUNCE,4,2       ; @BUS_DMA_COULD_BOUNCE
	.comm	_kernel_pmap,8,3                ; @kernel_pmap
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_EFBIG,4,2                      ; @EFBIG
	.no_dead_strip	_bounce_bus_dmamap_load_buffer
.subsections_via_symbols
