	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_gem_import                 ## -- Begin function msm_gem_import
	.p2align	4, 0x90
_msm_gem_import:                        ## @msm_gem_import
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_msm_use_mmu
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movl	(%r15), %edi
	callq	_PAGE_ALIGN
	movl	%eax, %r15d
	movq	_MSM_BO_WC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	xorl	%r8d, %r8d
	callq	_msm_gem_new_impl
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_2
LBB0_4:
	movq	-40(%rbp), %rdi
	callq	_drm_gem_object_put_unlocked
	movl	%r12d, %edi
	callq	_ERR_PTR
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_2:
	movq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_drm_gem_private_object_init
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	%r15d, %eax
	cltd
	idivl	(%rcx)
	movl	%eax, %r15d
	movq	-40(%rbp), %rdi
	callq	_to_msm_bo
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	%r14, 8(%rbx)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$8, %esi
	callq	_kvmalloc_array
	movl	%eax, 4(%rbx)
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	callq	_drm_prime_sg_to_page_addr_arrays
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testl	%r12d, %r12d
	jne	LBB0_4
## %bb.6:
	movq	-40(%rbp), %rax
	jmp	LBB0_7
LBB0_3:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot import without IOMMU\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MSM_BO_WC,4,2                  ## @MSM_BO_WC
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.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	_msm_gem_import                 ; -- Begin function msm_gem_import
	.p2align	2
_msm_gem_import:                        ; @msm_gem_import
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_msm_use_mmu
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w0, [x21]
	bl	_PAGE_ALIGN
	mov	x21, x0
Lloh0:
	adrp	x8, _MSM_BO_WC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSM_BO_WC@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x21
	mov	w4, #0
	bl	_msm_gem_new_impl
	mov	x22, x0
	cbz	w0, LBB0_5
LBB0_2:
	ldr	x0, [sp, #8]
	bl	_drm_gem_object_put_unlocked
	mov	x0, x22
	bl	_ERR_PTR
LBB0_3:
	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
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	w0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	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
	add	sp, sp, #64
	b	_ERR_PTR
LBB0_5:
	ldr	x1, [sp, #8]
	mov	x0, x20
	mov	x2, x21
	bl	_drm_gem_private_object_init
Lloh8:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	sdiv	w21, w21, w8
	ldr	x0, [sp, #8]
	bl	_to_msm_bo
	mov	x20, x0
	bl	_mutex_lock
	str	x19, [x20, #8]
Lloh11:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #8
	bl	_kvmalloc_array
	str	w0, [x20, #4]
	cbz	w0, LBB0_8
; %bb.6:
	mov	x1, x0
	mov	x0, x19
	mov	x2, #0
	mov	x3, x21
	bl	_drm_prime_sg_to_page_addr_arrays
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_unlock
	cbnz	w22, LBB0_2
; %bb.7:
	ldr	x0, [sp, #8]
	b	LBB0_3
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot import without IOMMU\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MSM_BO_WC,4,2                  ; @MSM_BO_WC
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
