	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viommu_add_resv_mem
_viommu_add_resv_mem:                   ## @viommu_add_resv_mem
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_IOMMU_WRITE@GOTPCREL(%rip), %rax
	movq	_IOMMU_NOEXEC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	orq	(%rax), %rbx
	movq	_IOMMU_MMIO@GOTPCREL(%rip), %rax
	orq	(%rax), %rbx
	movl	8(%rsi), %edi
	callq	_le64_to_cpu
	movl	%eax, %r15d
	movl	4(%r13), %edi
	callq	_le64_to_cpu
	subl	%r15d, %eax
	incl	%eax
	jne	LBB0_2
## %bb.1:
	movq	_EOVERFLOW@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_2:
	cmpq	$11, %r12
	ja	LBB0_4
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_4:
	movslq	%eax, %r12
	movl	(%r13), %edx
	movq	_IOMMU_RESV_RESERVED@GOTPCREL(%rip), %r13
	cmpl	$128, %edx
	je	LBB0_9
## %bb.5:
	cmpl	$129, %edx
	jne	LBB0_8
## %bb.6:
	movq	_IOMMU_RESV_MSI@GOTPCREL(%rip), %r13
	jmp	LBB0_10
LBB0_8:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_9:
	xorl	%ebx, %ebx
LBB0_10:
	movl	(%r13), %ecx
	movl	%r15d, %edi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_iommu_alloc_resv_region
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_list_add
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_13:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IOMMU_WRITE,8,3                ## @IOMMU_WRITE
	.comm	_IOMMU_NOEXEC,8,3               ## @IOMMU_NOEXEC
	.comm	_IOMMU_MMIO,8,3                 ## @IOMMU_MMIO
	.comm	_EOVERFLOW,4,2                  ## @EOVERFLOW
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown resv mem subtype 0x%x\n"

	.comm	_IOMMU_RESV_RESERVED,4,2        ## @IOMMU_RESV_RESERVED
	.comm	_IOMMU_RESV_MSI,4,2             ## @IOMMU_RESV_MSI
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_viommu_add_resv_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viommu_add_resv_mem
_viommu_add_resv_mem:                   ; @viommu_add_resv_mem
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _IOMMU_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IOMMU_WRITE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _IOMMU_NOEXEC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IOMMU_NOEXEC@GOTPAGEOFF]
Lloh4:
	ldr	x23, [x8]
Lloh5:
	ldr	x24, [x9]
Lloh6:
	adrp	x8, _IOMMU_MMIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IOMMU_MMIO@GOTPAGEOFF]
Lloh8:
	ldr	x25, [x8]
	ldr	w0, [x1, #8]
	bl	_le64_to_cpu
	mov	x20, x0
	ldr	w0, [x22, #4]
	bl	_le64_to_cpu
	sub	w8, w0, w20
	adds	w8, w8, #1
	b.lo	LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _EOVERFLOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EOVERFLOW@GOTPAGEOFF]
	b	LBB0_12
LBB0_2:
	cmp	x21, #11
	b.hi	LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_4:
	sxtw	x21, w8
	ldr	w2, [x22]
	cmp	w2, #128
	b.eq	LBB0_8
; %bb.5:
	cmp	w2, #129
	b.ne	LBB0_7
; %bb.6:
	orr	x8, x24, x23
	orr	x2, x8, x25
Lloh13:
	adrp	x8, _IOMMU_RESV_MSI@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IOMMU_RESV_MSI@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	ldr	w0, [x19, #4]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_8:
	mov	x2, #0
Lloh17:
	adrp	x8, _IOMMU_RESV_RESERVED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IOMMU_RESV_RESERVED@GOTPAGEOFF]
LBB0_9:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_iommu_alloc_resv_region
	cbz	x0, LBB0_11
; %bb.10:
	mov	x1, x0
	mov	x0, x19
	bl	_list_add
	mov	w0, #0
	b	LBB0_13
LBB0_11:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_IOMMU_WRITE,8,3                ; @IOMMU_WRITE
	.comm	_IOMMU_NOEXEC,8,3               ; @IOMMU_NOEXEC
	.comm	_IOMMU_MMIO,8,3                 ; @IOMMU_MMIO
	.comm	_EOVERFLOW,4,2                  ; @EOVERFLOW
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown resv mem subtype 0x%x\n"

	.comm	_IOMMU_RESV_RESERVED,4,2        ; @IOMMU_RESV_RESERVED
	.comm	_IOMMU_RESV_MSI,4,2             ; @IOMMU_RESV_MSI
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_viommu_add_resv_mem
.subsections_via_symbols
