	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arm_smmu_add_device
_arm_smmu_add_device:                   ## @arm_smmu_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_dev_iommu_fwspec_get
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	movq	32(%rax), %rax
	cmpq	_arm_smmu_ops@GOTPCREL(%rip), %rax
	je	LBB0_5
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	8(%rbx), %rdi
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	8(%rbx), %r12
	movq	16(%r12), %r15
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_18
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %r13d
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_arm_smmu_sid_in_range
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	_ARM_SMMU_FEAT_2_LVL_STRTAB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_arm_smmu_init_l2_strtab
	testl	%eax, %eax
	je	LBB0_17
	jmp	LBB0_4
LBB0_7:
	movl	24(%rbx), %edi
	callq	_arm_smmu_get_by_fwnode
	testq	%rax, %rax
	je	LBB0_2
## %bb.8:
	movq	%rax, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r12
	movq	%r14, 24(%rax)
	movq	%r15, 16(%rax)
	movq	16(%rbx), %rax
	movq	%rax, 8(%r12)
	movl	(%rbx), %eax
	movl	%eax, (%r12)
	movq	%r12, 8(%rbx)
	testl	%eax, %eax
	jg	LBB0_12
LBB0_18:
	movq	%r14, %rdi
	callq	_iommu_group_get_for_dev
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_iommu_group_put
	addq	$4, %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_iommu_device_link
LBB0_20:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR_OR_ZERO                ## TAILCALL
LBB0_14:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_arm_smmu_ops,4,2               ## @arm_smmu_ops
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_ARM_SMMU_FEAT_2_LVL_STRTAB,4,2 ## @ARM_SMMU_FEAT_2_LVL_STRTAB
	.no_dead_strip	_arm_smmu_add_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arm_smmu_add_device
_arm_smmu_add_device:                   ; @arm_smmu_add_device
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_dev_iommu_fwspec_get
	cbz	x0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	x8, [x0, #32]
Lloh0:
	adrp	x9, _arm_smmu_ops@GOTPAGE
Lloh1:
	ldr	x9, [x9, _arm_smmu_ops@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_5
LBB0_2:
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x0, [x22, #8]
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_12
; %bb.6:
	ldr	x21, [x22, #8]
	ldr	x20, [x21, #16]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_15
LBB0_7:
	mov	x23, #0
Lloh4:
	adrp	x24, _ARM_SMMU_FEAT_2_LVL_STRTAB@GOTPAGE
Lloh5:
	ldr	x24, [x24, _ARM_SMMU_FEAT_2_LVL_STRTAB@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x21]
	cmp	x23, x8
	b.ge	LBB0_15
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	w22, [x8, x23, lsl #2]
	mov	x0, x20
	mov	x1, x22
	bl	_arm_smmu_sid_in_range
	cbz	w0, LBB0_18
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x20]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_arm_smmu_init_l2_strtab
	cbz	w0, LBB0_8
	b	LBB0_4
LBB0_12:
	ldr	w0, [x22, #24]
	bl	_arm_smmu_get_by_fwnode
	cbz	x0, LBB0_2
; %bb.13:
	mov	x20, x0
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_19
; %bb.14:
	mov	x21, x0
	str	x19, [x0, #24]
	ldr	x8, [x22, #16]
	stp	x8, x20, [x0, #8]
	ldr	w8, [x22]
	str	w8, [x0]
	str	x0, [x22, #8]
	cmp	w8, #1
	b.ge	LBB0_7
LBB0_15:
	mov	x0, x19
	bl	_iommu_group_get_for_dev
	mov	x21, x0
	bl	_IS_ERR
	cbnz	w0, LBB0_17
; %bb.16:
	mov	x0, x21
	bl	_iommu_group_put
	add	x0, x20, #4
	mov	x1, x19
	bl	_iommu_device_link
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PTR_ERR_OR_ZERO
LBB0_18:
Lloh9:
	adrp	x8, _ERANGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_3
LBB0_19:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_arm_smmu_ops,4,2               ; @arm_smmu_ops
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_ARM_SMMU_FEAT_2_LVL_STRTAB,4,2 ; @ARM_SMMU_FEAT_2_LVL_STRTAB
	.no_dead_strip	_arm_smmu_add_device
.subsections_via_symbols
