	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_gem_userptr_init__mm_struct
_i915_gem_userptr_init__mm_struct:      ## @i915_gem_userptr_init__mm_struct
	.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, %r14
	movl	8(%rdi), %edi
	callq	_to_i915
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	_current@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	___i915_mm_struct_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_kref_get
	jmp	LBB0_5
LBB0_1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_kref_init
	movl	8(%r14), %edi
	callq	_to_i915
	movq	%rax, 32(%rbx)
	movq	(%r12), %rax
	movq	(%rax), %rdi
	movq	%rdi, 8(%rbx)
	callq	_mmgrab
	movq	$0, 24(%rbx)
	movl	4(%r15), %edi
	movq	%rbx, %rsi
	addq	$16, %rsi
	movq	8(%rbx), %rdx
	callq	_hash_add
LBB0_5:
	movq	%rbx, (%r14)
	xorl	%ebx, %ebx
LBB0_6:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_current,8,3                    ## @current
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_i915_gem_userptr_init__mm_struct
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_gem_userptr_init__mm_struct
_i915_gem_userptr_init__mm_struct:      ; @i915_gem_userptr_init__mm_struct
	.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	x20, x0
	ldr	w0, [x0, #8]
	bl	_to_i915
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x22, _current@GOTPAGE
Lloh1:
	ldr	x22, [x22, _current@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x1, [x8]
	mov	x0, x19
	bl	___i915_mm_struct_find
	cbz	x0, LBB0_2
; %bb.1:
	mov	x21, x0
	bl	_kref_get
	b	LBB0_4
LBB0_2:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x21, x0
	bl	_kref_init
	ldr	w0, [x20, #8]
	bl	_to_i915
	str	x0, [x21, #32]
	ldr	x8, [x22]
	ldr	x0, [x8]
	str	x0, [x21, #8]
	bl	_mmgrab
	str	xzr, [x21, #24]
	ldr	w0, [x19, #4]
	add	x1, x21, #16
	ldr	x2, [x21, #8]
	bl	_hash_add
LBB0_4:
	mov	w22, #0
	str	x21, [x20]
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	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
	ret
LBB0_6:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_current,8,3                    ; @current
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_i915_gem_userptr_init__mm_struct
.subsections_via_symbols
