	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viommu_probe_endpoint
_viommu_probe_endpoint:                 ## @viommu_probe_endpoint
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_dev_iommu_fwspec_get
	cmpl	$0, 8(%rax)
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	movq	16(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movslq	(%r12), %r14
	addq	$20, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rbx
	movq	_VIRTIO_IOMMU_T_PROBE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movl	%eax, 8(%rbx)
	movq	%r12, %rdi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_viommu_send_req_sync
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r14
	movl	(%r14), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movq	_VIRTIO_IOMMU_PROBE_T_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_VIRTIO_IOMMU_PROBE_T_NONE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	(%rax), %r15d
	je	LBB0_16
## %bb.7:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jae	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%r14), %edi
	callq	_le16_to_cpu
	movl	%eax, %r12d
	addl	$8, %r12d
	cmpl	$128, %r15d
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_viommu_add_resv_mem
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_13
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
	testl	%ebx, %ebx
	je	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movslq	%r12d, %rax
	addq	%rax, %r13
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jae	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r14
	movl	(%r14,%r13), %edi
	addq	%r13, %r14
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movq	_VIRTIO_IOMMU_PROBE_T_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_VIRTIO_IOMMU_PROBE_T_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_8
LBB0_16:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	jmp	LBB0_17
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VIRTIO_IOMMU_T_PROBE,4,2       ## @VIRTIO_IOMMU_T_PROBE
	.comm	_VIRTIO_IOMMU_PROBE_T_MASK,4,2  ## @VIRTIO_IOMMU_PROBE_T_MASK
	.comm	_VIRTIO_IOMMU_PROBE_T_NONE,4,2  ## @VIRTIO_IOMMU_PROBE_T_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown viommu prop 0x%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to parse viommu prop 0x%x\n"

	.no_dead_strip	_viommu_probe_endpoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viommu_probe_endpoint
_viommu_probe_endpoint:                 ; @viommu_probe_endpoint
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
	mov	x0, x1
	bl	_dev_iommu_fwspec_get
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x24, x0
	ldr	x22, [x0, #16]
	ldrsw	x8, [x20]
	add	x23, x8, #20
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.2:
	mov	x21, x0
Lloh3:
	adrp	x8, _VIRTIO_IOMMU_T_PROBE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIRTIO_IOMMU_T_PROBE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #12]
	ldr	x8, [x24]
	ldr	w0, [x8]
	bl	_cpu_to_le32
	str	w0, [x21, #8]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_viommu_send_req_sync
	mov	x23, x0
	cbnz	w0, LBB0_16
; %bb.3:
	ldr	x27, [x21]
	ldr	w0, [x27]
	bl	_le16_to_cpu
Lloh6:
	adrp	x8, _VIRTIO_IOMMU_PROBE_T_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIRTIO_IOMMU_PROBE_T_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w26, w8, w0
Lloh9:
	adrp	x24, _VIRTIO_IOMMU_PROBE_T_NONE@GOTPAGE
Lloh10:
	ldr	x24, [x24, _VIRTIO_IOMMU_PROBE_T_NONE@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w26, w8
	b.ne	LBB0_8
; %bb.4:
	mov	w23, #0
	b	LBB0_16
LBB0_5:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_8:
	mov	w23, #0
	mov	x25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x20]
	cmp	x25, x8
	b.hs	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x27, #4]
	bl	_le16_to_cpu
	add	w28, w0, #8
	cmp	w26, #128
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x22
	mov	x1, x27
	mov	x2, x28
	bl	_viommu_add_resv_mem
	mov	x23, x0
	cbnz	w23, LBB0_13
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x26
	bl	_dev_err
	cbz	w23, LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x26
	bl	_dev_err
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x25, x25, w28, sxtw
	ldrsw	x8, [x20]
	cmp	x25, x8
	b.hs	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x21]
	add	x27, x8, x25
	ldr	w0, [x27]
	bl	_le16_to_cpu
Lloh19:
	adrp	x8, _VIRTIO_IOMMU_PROBE_T_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VIRTIO_IOMMU_PROBE_T_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	and	w26, w8, w0
	ldr	w8, [x24]
	cmp	w26, w8
	b.ne	LBB0_9
LBB0_16:
	mov	x0, x21
	bl	_kfree
LBB0_17:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VIRTIO_IOMMU_T_PROBE,4,2       ; @VIRTIO_IOMMU_T_PROBE
	.comm	_VIRTIO_IOMMU_PROBE_T_MASK,4,2  ; @VIRTIO_IOMMU_PROBE_T_MASK
	.comm	_VIRTIO_IOMMU_PROBE_T_NONE,4,2  ; @VIRTIO_IOMMU_PROBE_T_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown viommu prop 0x%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to parse viommu prop 0x%x\n"

	.no_dead_strip	_viommu_probe_endpoint
.subsections_via_symbols
