	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__bus_dmamap_load_buffer        ## -- Begin function _bus_dmamap_load_buffer
	.p2align	4, 0x90
__bus_dmamap_load_buffer:               ## @_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
	movl	%r9d, %ebx
	movq	%r8, %r14
	movq	%rcx, %r13
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	16(%rbp), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	8(%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_2:
	movq	_BUS_DMA_COULD_BOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r13, %r8
	movl	%ebx, %r9d
	callq	__bus_dmamap_count_pages
	cmpq	$0, (%r12)
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	__bus_dmamap_reserve_pages
	testl	%eax, %eax
	jne	LBB0_17
LBB0_5:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_MIN
	movq	%rax, %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movq	%r12, %rcx
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	24(%rbp), %r9
	callq	__bus_dmamap_addseg
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	addq	%rax, %rbx
	subq	%rax, %r13
	testq	%rax, %rax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_15
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r13, %r13
	jle	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_pmap_kextract
	movl	%eax, %r14d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_pmap_extract
	movl	%eax, %r14d
	xorl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rsi
	movq	%r13, %rdi
	callq	_MIN
	movq	%rax, %r12
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	cltq
	subq	%rax, %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_run_filter
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	16(%r15), %esi
	movq	%rbx, %rdi
	callq	_roundup2
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_MIN
	movq	%rax, %r12
	movq	%r15, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	movq	%rax, %r8
	callq	_add_bounce_page
	movl	%eax, %r14d
	jmp	LBB0_14
LBB0_15:
	xorl	%eax, %eax
	testq	%r13, %r13
	je	LBB0_17
## %bb.16:
	movq	_EFBIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__bus_dmamap_load_buffer        ; -- Begin function _bus_dmamap_load_buffer
	.p2align	2
__bus_dmamap_load_buffer:               ; @_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, x1
	mov	x25, x0
	cbnz	x6, LBB0_2
; %bb.1:
	ldr	x21, [x24, #8]
LBB0_2:
	ldr	w8, [x25]
Lloh0:
	adrp	x9, _BUS_DMA_COULD_BOUNCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BUS_DMA_COULD_BOUNCE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
	mov	x0, x25
	mov	x1, x24
	mov	x2, x22
	mov	x3, x23
	mov	x4, x19
	mov	x5, x26
	bl	__bus_dmamap_count_pages
	ldr	x8, [x24]
	cbz	x8, LBB0_7
; %bb.4:
	mov	x0, x25
	mov	x1, x24
	mov	x2, x26
	bl	__bus_dmamap_reserve_pages
	cbnz	w0, LBB0_15
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x28
	bl	_MIN
	mov	x28, x0
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x25
	mov	x1, x24
	mov	x2, x26
	mov	x3, x28
	mov	x4, x21
	ldr	x5, [sp, #8]                    ; 8-byte Folded Reload
	bl	__bus_dmamap_addseg
	add	x23, x0, x23
	sub	x19, x19, x0
	cbz	x0, LBB0_14
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x19, #1
	b.lt	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh3:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh4:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_pmap_kextract
	mov	x26, x0
	mov	x27, x23
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_pmap_extract
	mov	x26, x0
	mov	x27, #0
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x1, [x25, #8]
	mov	x0, x19
	bl	_MIN
	mov	x28, x0
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _PAGE_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PAGE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w9, w9, w26
	sub	x20, x8, w9, sxtw
	ldr	x8, [x24]
	cbz	x8, LBB0_5
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x25
	mov	x1, x26
	bl	_run_filter
	cbz	x0, LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x25, #16]
	mov	x0, x20
	bl	_roundup2
	mov	x1, x28
	bl	_MIN
	mov	x28, x0
	mov	x0, x25
	mov	x1, x24
	mov	x2, x27
	mov	x3, x26
	mov	x4, x28
	bl	_add_bounce_page
	mov	x26, x0
	b	LBB0_6
LBB0_14:
Lloh12:
	adrp	x8, _EFBIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EFBIG@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	x19, #0
	csel	w0, wzr, w8, eq
LBB0_15:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.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
.subsections_via_symbols
