	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_register_device_fault_handler ## -- Begin function iommu_register_device_fault_handler
	.p2align	4, 0x90
_iommu_register_device_fault_handler:   ## @iommu_register_device_fault_handler
	.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	(%rdi), %r13
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpq	$0, 8(%r13)
	je	LBB0_5
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_5:
	movq	%r12, %rdi
	callq	_get_device
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	%r15d, 16(%rax)
	movq	%r14, 8(%rax)
	addq	$4, %rax
	movq	%rax, %rdi
	callq	_mutex_init
	movq	8(%r13), %rdi
	callq	_INIT_LIST_HEAD
	xorl	%ebx, %ebx
LBB0_8:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r12, %rdi
	callq	_put_device
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.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_register_device_fault_handler ; -- Begin function iommu_register_device_fault_handler
	.p2align	2
_iommu_register_device_fault_handler:   ; @iommu_register_device_fault_handler
	.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
	ldr	x19, [x0]
	cbz	x19, LBB0_4
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_5:
	mov	x0, x22
	bl	_get_device
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_9
; %bb.6:
	str	w21, [x0, #16]
	str	x20, [x0, #8]
	add	x0, x0, #4
	bl	_mutex_init
	ldr	x0, [x19, #8]
	bl	_INIT_LIST_HEAD
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_8:
	mov	x0, x20
	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_9:
	mov	x0, x22
	bl	_put_device
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
