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