	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usnic_uiom_attach_dev_to_pd    ## -- Begin function usnic_uiom_attach_dev_to_pd
	.p2align	4, 0x90
_usnic_uiom_attach_dev_to_pd:           ## @usnic_uiom_attach_dev_to_pd
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r15, 8(%rax)
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_iommu_attach_device
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_3:
	movl	(%r15), %edi
	movq	_IOMMU_CAP_CACHE_COHERENCY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_iommu_capable
	testl	%eax, %eax
	je	LBB0_4
## %bb.7:
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	leaq	12(%r14), %rsi
	movq	%r12, %rdi
	callq	_list_add_tail
	incl	8(%r14)
	movq	%rbx, %rdi
	callq	_spin_unlock
	xorl	%ebx, %ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r15, %rdi
	callq	_dev_name
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_usnic_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_iommu_detach_device
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IOMMU_CAP_CACHE_COHERENCY,4,2  ## @IOMMU_CAP_CACHE_COHERENCY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IOMMU of %s does not support cache coherency\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usnic_uiom_attach_dev_to_pd    ; -- Begin function usnic_uiom_attach_dev_to_pd
	.p2align	2
_usnic_uiom_attach_dev_to_pd:           ; @usnic_uiom_attach_dev_to_pd
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x21, [x0, #8]
	ldr	w0, [x19]
	mov	x1, x21
	bl	_iommu_attach_device
	mov	x22, x0
	cbz	w0, LBB0_4
LBB0_2:
	mov	x0, x20
	bl	_kfree
	b	LBB0_6
LBB0_3:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_6
LBB0_4:
	ldr	w0, [x21]
Lloh6:
	adrp	x8, _IOMMU_CAP_CACHE_COHERENCY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IOMMU_CAP_CACHE_COHERENCY@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_iommu_capable
	cbz	w0, LBB0_7
; %bb.5:
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock
	add	x1, x19, #12
	mov	x0, x20
	bl	_list_add_tail
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
	mov	x0, x21
	bl	_spin_unlock
	mov	w22, #0
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x21
	bl	_dev_name
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_usnic_err
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	w0, [x19]
	mov	x1, x21
	bl	_iommu_detach_device
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IOMMU_CAP_CACHE_COHERENCY,4,2  ; @IOMMU_CAP_CACHE_COHERENCY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IOMMU of %s does not support cache coherency\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
