	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_context_open          ## -- Begin function i915_gem_context_open
	.p2align	4, 0x90
_i915_gem_context_open:                 ## @i915_gem_context_open
	.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	%rdi, %rbx
	movq	(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_init
	leaq	4(%r14), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_init
	leaq	8(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_idr_init
	leaq	12(%r14), %r12
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_idr_init_base
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_i915_gem_create_context
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
LBB0_5:
	movq	%r12, %rdi
	callq	_idr_destroy
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_idr_destroy
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_destroy
	movq	%r14, %rdi
	callq	_mutex_destroy
	jmp	LBB0_6
LBB0_2:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_gem_context_register
	movl	%eax, %r13d
	movq	%r15, %rdi
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	callq	_i915_gem_context_is_kernel
	movl	%eax, %edi
	callq	_GEM_BUG_ON
	xorl	%edi, %edi
	testl	%r13d, %r13d
	setne	%dil
	callq	_GEM_BUG_ON
	xorl	%r13d, %r13d
LBB0_6:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	_context_close
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_context_open          ; -- Begin function i915_gem_context_open
	.p2align	2
_i915_gem_context_open:                 ; @i915_gem_context_open
	.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	x23, x0
	ldr	x19, [x1]
	mov	x0, x19
	bl	_mutex_init
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_init
	add	x21, x19, #8
	mov	x0, x21
	bl	_idr_init
	add	x22, x19, #12
	mov	x0, x22
	mov	w1, #1
	bl	_idr_init_base
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x23
	mov	w1, #0
	bl	_i915_gem_create_context
	mov	x24, x0
	mov	x0, x23
	bl	_mutex_unlock
	mov	x0, x24
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x24
	bl	_PTR_ERR
	mov	x23, x0
LBB0_2:
	mov	x0, x22
	bl	_idr_destroy
	mov	x0, x21
	bl	_idr_destroy
	mov	x0, x20
	bl	_mutex_destroy
	mov	x0, x19
	bl	_mutex_destroy
	b	LBB0_5
LBB0_3:
	mov	x0, x24
	mov	x1, x19
	bl	_gem_context_register
	mov	x23, x0
	tbnz	w0, #31, LBB0_6
; %bb.4:
	mov	x0, x24
	bl	_i915_gem_context_is_kernel
	bl	_GEM_BUG_ON
	cmp	w23, #0
	cset	w0, ne
	bl	_GEM_BUG_ON
	mov	w23, #0
LBB0_5:
	mov	x0, x23
	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_6:
	mov	x0, x24
	bl	_context_close
	b	LBB0_2
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
