	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_group_add_device         ## -- Begin function iommu_group_add_device
	.p2align	4, 0x90
_iommu_group_add_device:                ## @iommu_group_add_device
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r15, 16(%rax)
	leaq	28(%r14), %rsi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_sysfs_create_link
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_kobject_name
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_kasprintf
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	xorl	%r13d, %r13d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r14), %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_sysfs_create_link_nowarn
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %ebx
	movq	_EEXIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r12), %rdi
	callq	_kfree
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_kobject_name
	movq	%r14, %r15
	leal	1(%r13), %r14d
	movl	%ebx, %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_kasprintf
	movq	%rax, (%r12)
	movl	%r14d, %r13d
	movq	%r15, %r14
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	testq	%rax, %rax
	jne	LBB0_5
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_9:
	movl	4(%r14), %edi
	callq	_kobject_get
	movq	%r14, 8(%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_iommu_group_create_direct_mappings
	leaq	8(%r14), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	addq	$8, %r13
	leaq	24(%r14), %rsi
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.11:
	movq	%r15, %rsi
	callq	___iommu_attach_device
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.13:
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_list_del
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	$0, 8(%r15)
	movl	4(%r14), %edi
	callq	_kobject_put
LBB0_14:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rdi
	callq	_kfree
LBB0_15:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_sysfs_remove_link
LBB0_16:
	movq	%r12, %rdi
	callq	_kfree
	movl	(%r14), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_dev_err
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_12:
	leaq	12(%r14), %rdi
	movq	_IOMMU_GROUP_NOTIFY_ADD_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	callq	_blocking_notifier_call_chain
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_trace_add_device_to_group
	movl	(%r14), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"iommu_group"

L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_EEXIST,4,2                     ## @EEXIST
L_.str.2:                               ## @.str.2
	.asciz	"%s.%d"

	.comm	_IOMMU_GROUP_NOTIFY_ADD_DEVICE,4,2 ## @IOMMU_GROUP_NOTIFY_ADD_DEVICE
L_.str.3:                               ## @.str.3
	.asciz	"Adding to iommu group %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to add to iommu group %d: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_group_add_device         ; -- Begin function iommu_group_add_device
	.p2align	2
_iommu_group_add_device:                ; @iommu_group_add_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x21, x0
	str	x19, [x0, #16]
	add	x1, x20, #28
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_sysfs_create_link
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.2:
	ldr	w22, [x24]
	mov	x0, x19
	bl	_kobject_name
	mov	x2, x0
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_kasprintf
	str	x0, [x21]
	cbz	x0, LBB0_7
; %bb.3:
	mov	x2, x0
	mov	w26, #0
Lloh6:
	adrp	x25, _EEXIST@GOTPAGE
Lloh7:
	ldr	x25, [x25, _EEXIST@GOTPAGEOFF]
Lloh8:
	adrp	x23, l_.str.2@PAGE
Lloh9:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #4]
	mov	x1, x19
	bl	_sysfs_create_link_nowarn
	cbz	w0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x0
	ldr	w8, [x25]
	cmn	w0, w8
	b.ne	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x21]
	bl	_kfree
	ldr	w22, [x24]
	mov	x0, x19
	bl	_kobject_name
	mov	x2, x0
	add	w27, w26, #1
	str	x26, [sp]
	mov	x0, x22
	mov	x1, x23
	bl	_kasprintf
	mov	x2, x0
	str	x0, [x21]
	mov	x26, x27
	cbnz	x0, LBB0_4
LBB0_7:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_8:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_15
LBB0_9:
	ldr	w0, [x20, #4]
	bl	_kobject_get
	str	x20, [x19, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_iommu_group_create_direct_mappings
	add	x23, x20, #8
	mov	x0, x23
	bl	_mutex_lock
	add	x24, x21, #8
	add	x1, x20, #24
	mov	x0, x24
	bl	_list_add_tail
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_16
; %bb.10:
	mov	x1, x19
	bl	___iommu_attach_device
	mov	x22, x0
	mov	x0, x23
	bl	_mutex_unlock
	cbz	w22, LBB0_17
; %bb.11:
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x24
	bl	_list_del
	mov	x0, x23
	bl	_mutex_unlock
	str	xzr, [x19, #8]
	ldr	w0, [x20, #4]
	bl	_kobject_put
LBB0_12:
	ldr	x0, [x21]
	bl	_kfree
LBB0_13:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_sysfs_remove_link
LBB0_14:
	mov	x0, x21
	bl	_kfree
	ldr	w2, [x20]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x3, x22
	bl	_dev_err
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	mov	x0, x23
	bl	_mutex_unlock
LBB0_17:
	add	x0, x20, #12
Lloh20:
	adrp	x8, _IOMMU_GROUP_NOTIFY_ADD_DEVICE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IOMMU_GROUP_NOTIFY_ADD_DEVICE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_blocking_notifier_call_chain
	ldr	w0, [x20]
	mov	x1, x19
	bl	_trace_add_device_to_group
	ldr	w2, [x20]
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w22, #0
	b	LBB0_15
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"iommu_group"

l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_EEXIST,4,2                     ; @EEXIST
l_.str.2:                               ; @.str.2
	.asciz	"%s.%d"

	.comm	_IOMMU_GROUP_NOTIFY_ADD_DEVICE,4,2 ; @IOMMU_GROUP_NOTIFY_ADD_DEVICE
l_.str.3:                               ; @.str.3
	.asciz	"Adding to iommu group %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to add to iommu group %d: %d\n"

.subsections_via_symbols
