	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_gas_map                   ## -- Begin function dmar_gas_map
	.p2align	4, 0x90
_dmar_gas_map:                          ## @dmar_gas_map
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_DMAR_GM_CANWAIT@GOTPCREL(%rip), %r15
	movq	_DMAR_GM_CANSPLIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r15), %eax
	notl	%eax
	xorl	%edi, %edi
	testl	%r9d, %eax
	sete	%dil
	movslq	%r9d, %rbx
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_DMAR_PGF_WAITOK@GOTPCREL(%rip), %rax
	andl	(%r15), %ebx
	je	LBB0_2
## %bb.1:
	movl	(%rax), %ebx
LBB0_2:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_dmar_gas_alloc_entry
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_DMAR_DOMAIN_LOCK
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%r14d, %r8d
	movq	%r15, %r9
	callq	_dmar_gas_find_space
	movl	%eax, %ebx
	movq	_ENOMEM@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_DMAR_DOMAIN_UNLOCK
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_dmar_gas_free_entry
	jmp	LBB0_19
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_19
LBB0_6:
	xorl	%edi, %edi
	testl	%ebx, %ebx
	sete	%dil
	movslq	%ebx, %rsi
	callq	_KASSERT
	movq	(%r12), %rax
	xorl	%edi, %edi
	cmpq	%rax, (%r15)
	setl	%dil
	movslq	%eax, %rsi
	callq	_KASSERT
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	orl	%ebx, 8(%r15)
	movq	%r12, %rdi
	callq	_DMAR_DOMAIN_UNLOCK
	movq	_DMAR_MAP_ENTRY_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	je	LBB0_8
## %bb.7:
	movq	_DMAR_PTE_R@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	movq	_DMAR_MAP_ENTRY_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	andl	%ebx, %r8d
	je	LBB0_10
## %bb.9:
	movq	_DMAR_PTE_W@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
LBB0_10:
	movq	_DMAR_MAP_ENTRY_SNOOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ebx, %ecx
	je	LBB0_12
## %bb.11:
	movq	_DMAR_PTE_SNP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_12:
	movq	(%r15), %rdx
	movq	16(%r15), %rsi
	orl	%eax, %r8d
	movq	_DMAR_MAP_ENTRY_TM@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	je	LBB0_14
## %bb.13:
	movq	_DMAR_PTE_TM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_14:
	orl	%ebx, %ecx
	orl	%ecx, %r8d
	movq	16(%rbp), %rcx
	subq	%rsi, %rdx
	movq	_DMAR_GM_CANWAIT@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	je	LBB0_16
## %bb.15:
	movq	_DMAR_PGF_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_16:
	movq	%r12, %rdi
	movl	%r14d, %r9d
	callq	_domain_map_buf
	movl	%eax, %ebx
	cmpl	(%r13), %eax
	jne	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_dmar_domain_unload_entry
	jmp	LBB0_19
LBB0_18:
	movq	24(%rbp), %r14
	xorl	%edi, %edi
	testl	%ebx, %ebx
	sete	%dil
	movslq	%ebx, %rsi
	callq	_KASSERT
	movq	%r15, (%r14)
	xorl	%ebx, %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_GM_CANWAIT,4,2            ## @DMAR_GM_CANWAIT
	.comm	_DMAR_GM_CANSPLIT,4,2           ## @DMAR_GM_CANSPLIT
	.comm	_DMAR_PGF_WAITOK,4,2            ## @DMAR_PGF_WAITOK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMAR_MAP_ENTRY_READ,4,2        ## @DMAR_MAP_ENTRY_READ
	.comm	_DMAR_PTE_R,4,2                 ## @DMAR_PTE_R
	.comm	_DMAR_MAP_ENTRY_WRITE,4,2       ## @DMAR_MAP_ENTRY_WRITE
	.comm	_DMAR_PTE_W,4,2                 ## @DMAR_PTE_W
	.comm	_DMAR_MAP_ENTRY_SNOOP,4,2       ## @DMAR_MAP_ENTRY_SNOOP
	.comm	_DMAR_PTE_SNP,4,2               ## @DMAR_PTE_SNP
	.comm	_DMAR_MAP_ENTRY_TM,4,2          ## @DMAR_MAP_ENTRY_TM
	.comm	_DMAR_PTE_TM,4,2                ## @DMAR_PTE_TM
	.comm	_dmar_check_free,8,3            ## @dmar_check_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_gas_map                   ; -- Begin function dmar_gas_map
	.p2align	2
_dmar_gas_map:                          ; @dmar_gas_map
	.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	x23, x5
	mov	x24, x4
	mov	x25, x3
	mov	x26, x2
	mov	x27, x1
	mov	x22, x0
Lloh0:
	adrp	x28, _DMAR_GM_CANWAIT@GOTPAGE
Lloh1:
	ldr	x28, [x28, _DMAR_GM_CANWAIT@GOTPAGEOFF]
Lloh2:
	adrp	x8, _DMAR_GM_CANSPLIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMAR_GM_CANSPLIT@GOTPAGEOFF]
	ldr	w9, [x28]
Lloh4:
	ldr	w8, [x8]
	orr	w8, w8, w9
	bics	wzr, w5, w8
	cset	w0, eq
	sxtw	x1, w23
	bl	_KASSERT
	ldr	w8, [x28]
Lloh5:
	adrp	x19, _DMAR_PGF_WAITOK@GOTPAGE
Lloh6:
	ldr	x19, [x19, _DMAR_PGF_WAITOK@GOTPAGEOFF]
	ldr	w9, [x19]
	tst	w8, w23
	csel	w1, wzr, w9, eq
	mov	x0, x22
	bl	_dmar_gas_alloc_entry
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	mov	x0, x22
	bl	_DMAR_DOMAIN_LOCK
	mov	x0, x22
	mov	x1, x27
	mov	x2, x26
	mov	x3, x25
	mov	x4, x23
	mov	x5, x20
	bl	_dmar_gas_find_space
	mov	x25, x0
Lloh7:
	adrp	x26, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x26, [x26, _ENOMEM@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_DMAR_DOMAIN_UNLOCK
	mov	x0, x22
	mov	x1, x20
	bl	_dmar_gas_free_entry
	b	LBB0_7
LBB0_3:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w25, [x8]
	b	LBB0_7
LBB0_4:
	cmp	w25, #0
	cset	w0, eq
	sxtw	x1, w25
	bl	_KASSERT
	ldr	x8, [x20]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w0, lt
	sxtw	x1, w9
	bl	_KASSERT
	ldr	w8, [x20, #8]
	orr	w8, w8, w24
	str	w8, [x20, #8]
	mov	x0, x22
	bl	_DMAR_DOMAIN_UNLOCK
	ldr	x1, [x20, #16]
	ldr	x8, [x20]
	sub	x2, x8, x1
Lloh12:
	adrp	x8, _DMAR_MAP_ENTRY_READ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMAR_MAP_ENTRY_READ@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _DMAR_PTE_R@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DMAR_PTE_R@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w8, w24
Lloh18:
	adrp	x8, _DMAR_MAP_ENTRY_WRITE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMAR_MAP_ENTRY_WRITE@GOTPAGEOFF]
	csel	w9, wzr, w9, eq
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x10, _DMAR_PTE_W@GOTPAGE
Lloh22:
	ldr	x10, [x10, _DMAR_PTE_W@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	tst	w8, w24
	csel	w8, wzr, w10, eq
	orr	w8, w8, w9
Lloh24:
	adrp	x9, _DMAR_MAP_ENTRY_SNOOP@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DMAR_MAP_ENTRY_SNOOP@GOTPAGEOFF]
Lloh26:
	adrp	x10, _DMAR_PTE_SNP@GOTPAGE
Lloh27:
	ldr	x10, [x10, _DMAR_PTE_SNP@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
Lloh29:
	ldr	w10, [x10]
	tst	w9, w24
	csel	w9, wzr, w10, eq
Lloh30:
	adrp	x10, _DMAR_MAP_ENTRY_TM@GOTPAGE
Lloh31:
	ldr	x10, [x10, _DMAR_MAP_ENTRY_TM@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh32:
	ldr	w9, [x10]
Lloh33:
	adrp	x10, _DMAR_PTE_TM@GOTPAGE
Lloh34:
	ldr	x10, [x10, _DMAR_PTE_TM@GOTPAGEOFF]
Lloh35:
	ldr	w10, [x10]
	tst	w9, w24
	csel	w9, wzr, w10, eq
	orr	w4, w8, w9
	ldr	w8, [x28]
	ldr	w9, [x19]
	tst	w8, w23
	csel	w5, wzr, w9, eq
	mov	x0, x22
	mov	x3, x21
	bl	_domain_map_buf
	mov	x25, x0
	ldr	w8, [x26]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x20
	mov	w1, #1
	bl	_dmar_domain_unload_entry
	b	LBB0_7
LBB0_6:
	cmp	w25, #0
	cset	w0, eq
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	sxtw	x1, w25
	bl	_KASSERT
	mov	w25, #0
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	x20, [x8]
LBB0_7:
	mov	x0, x25
	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	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_GM_CANWAIT,4,2            ; @DMAR_GM_CANWAIT
	.comm	_DMAR_GM_CANSPLIT,4,2           ; @DMAR_GM_CANSPLIT
	.comm	_DMAR_PGF_WAITOK,4,2            ; @DMAR_PGF_WAITOK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMAR_MAP_ENTRY_READ,4,2        ; @DMAR_MAP_ENTRY_READ
	.comm	_DMAR_PTE_R,4,2                 ; @DMAR_PTE_R
	.comm	_DMAR_MAP_ENTRY_WRITE,4,2       ; @DMAR_MAP_ENTRY_WRITE
	.comm	_DMAR_PTE_W,4,2                 ; @DMAR_PTE_W
	.comm	_DMAR_MAP_ENTRY_SNOOP,4,2       ; @DMAR_MAP_ENTRY_SNOOP
	.comm	_DMAR_PTE_SNP,4,2               ; @DMAR_PTE_SNP
	.comm	_DMAR_MAP_ENTRY_TM,4,2          ; @DMAR_MAP_ENTRY_TM
	.comm	_DMAR_PTE_TM,4,2                ; @DMAR_PTE_TM
	.comm	_dmar_check_free,8,3            ; @dmar_check_free
.subsections_via_symbols
