	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_bus_dmamap_load_buffer
_dmar_bus_dmamap_load_buffer:           ## @dmar_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	$88, %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, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edi
	callq	_trunc_page
	movq	%rax, %r13
	leal	(%r14,%r15), %edi
	callq	_round_page
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r14d
	subq	%r13, %rax
	movq	%rax, %rdi
	callq	_OFF_TO_IDX
                                        ## kill: def $eax killed $eax def $rax
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	cmpq	$0, (%r12)
	jne	LBB0_1
## %bb.2:
	movl	%ebx, %r12d
	movq	_M_NOWAIT@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movl	%ebx, %r12d
	movq	_M_WAITOK@GOTPCREL(%rip), %rcx
LBB0_3:
	movl	(%rcx), %edx
	movq	%rax, %rbx
	leal	(,%rax,8), %edi
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%edx, -64(%rbp)                 ## 4-byte Spill
	callq	_malloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	testl	%ebx, %ebx
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	jle	LBB0_5
## %bb.6:
	movq	%rbx, %rax
	movl	%eax, %ecx
	shll	$2, %eax
	shlq	$2, %rcx
	movq	%rcx, -120(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%ecx, %ecx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_13
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%r15), %r14
	movq	_VM_MEMATTR_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_vm_page_initfake
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax,%r15,2)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	addq	$4, %r15
	cmpq	%r15, -120(%rbp)                ## 8-byte Folded Reload
	je	LBB0_18
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_pmap_kextract
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_pmap_extract
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_PHYS_TO_VM_PAGE
	movq	%rax, (%r14,%r15,2)
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rdi
	callq	_VM_PAGE_TO_PHYS
	cmpq	%r12, %rax
	jne	LBB0_12
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	-64(%rbp), %edx                 ## 4-byte Folded Reload
	movq	-112(%rbp), %rdi                ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_malloc
	testq	%rax, %rax
	jne	LBB0_16
## %bb.14:
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_free
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_19
LBB0_5:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_18:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movq	%r14, %rdx
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-88(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	pushq	24(%rbp)
	pushq	16(%rbp)
	callq	_dmar_bus_dmamap_load_something
	addq	$16, %rsp
	movq	%r14, %rdi
	movl	%eax, %r14d
	movq	_M_DEVBUF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_free
	movl	(%rbx), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	movl	%r14d, %eax
LBB0_19:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_kernel_pmap,8,3                ## @kernel_pmap
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_VM_MEMATTR_DEFAULT,4,2         ## @VM_MEMATTR_DEFAULT
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_dmar_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 dmar_bus_dmamap_load_buffer
_dmar_bus_dmamap_load_buffer:           ; @dmar_bus_dmamap_load_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x19, x7
	mov	x20, x6
	mov	x21, x5
	mov	x26, x4
	mov	x22, x3
	mov	x28, x2
	mov	x23, x1
	mov	x25, x0
	mov	x0, x28
	bl	_trunc_page
	mov	x27, x0
	add	w0, w28, w22
	bl	_round_page
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #60]                   ; 4-byte Folded Spill
	sub	x0, x0, x27
	bl	_OFF_TO_IDX
	mov	x24, x0
	ldr	x8, [x23]
Lloh3:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh5:
	adrp	x10, _M_NOWAIT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _M_NOWAIT@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w2, [x8]
	lsl	w0, w0, #3
Lloh7:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	str	w2, [sp, #76]                   ; 4-byte Folded Spill
	bl	_malloc
	str	x0, [sp, #64]                   ; 8-byte Folded Spill
	cbz	x0, LBB0_13
; %bb.1:
	cmp	w24, #1
	stp	x20, x19, [sp, #40]             ; 16-byte Folded Spill
	stp	w22, w21, [sp, #32]             ; 8-byte Folded Spill
	stp	x25, x23, [sp, #16]             ; 16-byte Folded Spill
	str	x28, [sp, #8]                   ; 8-byte Folded Spill
	b.lt	LBB0_14
; %bb.2:
	mov	x23, #0
	mov	x20, #0
	lsl	w8, w24, #2
	str	w8, [sp, #72]                   ; 4-byte Folded Spill
	mov	w8, w24
Lloh10:
	adrp	x25, _kernel_pmap@GOTPAGE
Lloh11:
	ldr	x25, [x25, _kernel_pmap@GOTPAGEOFF]
	lsl	x28, x8, #2
Lloh12:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x19, [sp, #64]                  ; 8-byte Folded Reload
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	cbz	x20, LBB0_11
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x20, x23
Lloh14:
	adrp	x8, _VM_MEMATTR_DEFAULT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VM_MEMATTR_DEFAULT@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x24
	bl	_vm_page_initfake
	str	x22, [x19]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x21]
	add	x27, x8, x27
	add	x23, x23, #4
	add	x19, x19, #8
	cmp	x28, x23
	b.eq	LBB0_15
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	cmp	x8, x26
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x27
	bl	_pmap_kextract
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x26
	mov	x1, x27
	bl	_pmap_extract
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x24, x0
	bl	_PHYS_TO_VM_PAGE
	str	x0, [x19]
	cbz	x0, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	bl	_VM_PAGE_TO_PHYS
	cmp	x0, x24
	b.ne	LBB0_3
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh17:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh18:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _M_ZERO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _M_ZERO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldp	w0, w9, [sp, #72]               ; 8-byte Folded Reload
	orr	w2, w8, w9
	bl	_malloc
	mov	x20, x0
	cbnz	x0, LBB0_4
; %bb.12:
Lloh23:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh24:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	x0, [sp, #64]                   ; 8-byte Folded Reload
	bl	_free
LBB0_13:
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	b	LBB0_16
LBB0_14:
	mov	x20, #0
LBB0_15:
	ldp	x8, x0, [sp, #8]                ; 16-byte Folded Reload
	ldr	w9, [sp, #60]                   ; 4-byte Folded Reload
	and	w3, w9, w8
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x22, [sp, #64]                  ; 8-byte Folded Reload
	mov	x2, x22
	ldp	w4, w5, [sp, #32]               ; 8-byte Folded Reload
	ldp	x6, x7, [sp, #40]               ; 16-byte Folded Reload
	bl	_dmar_bus_dmamap_load_something
	mov	x19, x0
Lloh29:
	adrp	x21, _M_DEVBUF@GOTPAGE
Lloh30:
	ldr	x21, [x21, _M_DEVBUF@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x22
	bl	_free
	ldr	w1, [x21]
	mov	x0, x20
	bl	_free
	mov	x0, x19
LBB0_16:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_kernel_pmap,8,3                ; @kernel_pmap
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_VM_MEMATTR_DEFAULT,4,2         ; @VM_MEMATTR_DEFAULT
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_dmar_bus_dmamap_load_buffer
.subsections_via_symbols
