	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_context_destroy_ioctl ## -- Begin function i915_gem_context_destroy_ioctl
	.p2align	4, 0x90
_i915_gem_context_destroy_ioctl:        ## @i915_gem_context_destroy_ioctl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, (%rsi)
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	movq	%rsi, %rbx
	cmpl	$0, 8(%rsi)
	je	LBB0_4
## %bb.5:
	movq	(%rdx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_EINTR@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_7:
	leaq	4(%r14), %rdi
	movl	8(%rbx), %esi
	callq	_idr_remove
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_mutex_unlock
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.8:
	movq	%rbx, %rdi
	callq	_context_close
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_4:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EINTR,4,2                      ## @EINTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_context_destroy_ioctl ; -- Begin function i915_gem_context_destroy_ioctl
	.p2align	2
_i915_gem_context_destroy_ioctl:        ; @i915_gem_context_destroy_ioctl
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x1]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_2:
	mov	x19, x1
	ldr	w8, [x1, #8]
	cbz	w8, LBB0_7
; %bb.3:
	ldr	x20, [x2]
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_5
; %bb.4:
Lloh2:
	adrp	x8, _EINTR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	add	x0, x20, #4
	ldr	w1, [x19, #8]
	bl	_idr_remove
	mov	x19, x0
	mov	x0, x20
	bl	_mutex_unlock
	cbz	x19, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_context_close
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh4:
	adrp	x8, _ENOENT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EINTR,4,2                      ; @EINTR
.subsections_via_symbols
