	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipmmu_init_arm_mapping
_ipmmu_init_arm_mapping:                ## @ipmmu_init_arm_mapping
	.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	%rdi, %r12
	callq	_to_ipmmu
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_iommu_group_alloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.11:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_iommu_group_add_device
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_iommu_group_put
	testl	%r15d, %r15d
	js	LBB0_2
## %bb.3:
	movq	(%r14), %r15
	testq	%r15, %r15
	je	LBB0_4
LBB0_6:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_arm_iommu_attach_device
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jns	LBB0_10
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movl	%ebx, %r15d
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_10
LBB0_4:
	movq	_SZ_1G@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SZ_2G@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_platform_bus_type@GOTPCREL(%rip), %rdi
	callq	_arm_iommu_create_mapping
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.12:
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
LBB0_8:
	movq	%r12, %rdi
	callq	_iommu_group_remove_device
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_arm_iommu_release_mapping
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r15, (%r14)
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate IOMMU group\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to add device to IPMMU group\n"

	.comm	_platform_bus_type,4,2          ## @platform_bus_type
	.comm	_SZ_1G,4,2                      ## @SZ_1G
	.comm	_SZ_2G,4,2                      ## @SZ_2G
L_.str.2:                               ## @.str.2
	.asciz	"failed to create ARM IOMMU mapping\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to attach device to VA mapping\n"

	.no_dead_strip	_ipmmu_init_arm_mapping
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipmmu_init_arm_mapping
_ipmmu_init_arm_mapping:                ; @ipmmu_init_arm_mapping
	.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	x19, x0
	bl	_to_ipmmu
	mov	x20, x0
	bl	_iommu_group_alloc
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	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
	b	_PTR_ERR
LBB0_2:
	mov	x0, x22
	mov	x1, x19
	bl	_iommu_group_add_device
	mov	x21, x0
	mov	x0, x22
	bl	_iommu_group_put
	tbnz	w21, #31, LBB0_6
; %bb.3:
	ldr	x21, [x20]
	cbz	x21, LBB0_7
LBB0_4:
	mov	x0, x19
	mov	x1, x21
	bl	_arm_iommu_attach_device
	tbnz	w0, #31, LBB0_9
; %bb.5:
	mov	w21, #0
	b	LBB0_12
LBB0_6:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_12
LBB0_7:
Lloh4:
	adrp	x8, _SZ_1G@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SZ_1G@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _SZ_2G@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SZ_2G@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x0, _platform_bus_type@GOTPAGE
Lloh11:
	ldr	x0, [x0, _platform_bus_type@GOTPAGEOFF]
	bl	_arm_iommu_create_mapping
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.8:
	ldr	x0, [x20, #8]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	mov	x0, x21
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_10
LBB0_9:
	mov	x21, x0
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_10:
	mov	x0, x19
	bl	_iommu_group_remove_device
	ldr	x0, [x20]
	cbz	x0, LBB0_12
; %bb.11:
	bl	_arm_iommu_release_mapping
LBB0_12:
	mov	x0, x21
	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_13:
	str	x21, [x20]
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate IOMMU group\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to add device to IPMMU group\n"

	.comm	_platform_bus_type,4,2          ; @platform_bus_type
	.comm	_SZ_1G,4,2                      ; @SZ_1G
	.comm	_SZ_2G,4,2                      ; @SZ_2G
l_.str.2:                               ; @.str.2
	.asciz	"failed to create ARM IOMMU mapping\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to attach device to VA mapping\n"

	.no_dead_strip	_ipmmu_init_arm_mapping
.subsections_via_symbols
