	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_get_msi_cookie           ## -- Begin function iommu_get_msi_cookie
	.p2align	4, 0x90
_iommu_get_msi_cookie:                  ## @iommu_get_msi_cookie
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rax
	movq	_IOMMU_DOMAIN_UNMANAGED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movq	%rdi, %rbx
	cmpq	$0, 8(%rdi)
	je	LBB0_5
## %bb.4:
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movl	%esi, %r14d
	movq	_IOMMU_DMA_MSI_COOKIE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cookie_alloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	%r14d, (%rax)
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_IOMMU_DOMAIN_UNMANAGED,8,3     ## @IOMMU_DOMAIN_UNMANAGED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_IOMMU_DMA_MSI_COOKIE,4,2       ## @IOMMU_DMA_MSI_COOKIE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_get_msi_cookie           ; -- Begin function iommu_get_msi_cookie
	.p2align	2
_iommu_get_msi_cookie:                  ; @iommu_get_msi_cookie
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _IOMMU_DOMAIN_UNMANAGED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IOMMU_DOMAIN_UNMANAGED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _EEXIST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x20, x1
Lloh7:
	adrp	x8, _IOMMU_DMA_MSI_COOKIE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IOMMU_DMA_MSI_COOKIE@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_cookie_alloc
	cbz	x0, LBB0_8
; %bb.7:
	mov	x8, x0
	mov	w0, #0
	str	w20, [x8]
	str	x8, [x19, #8]
	b	LBB0_5
LBB0_8:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_IOMMU_DOMAIN_UNMANAGED,8,3     ; @IOMMU_DOMAIN_UNMANAGED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_IOMMU_DMA_MSI_COOKIE,4,2       ; @IOMMU_DMA_MSI_COOKIE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
