	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_context_reset_stats_ioctl ## -- Begin function i915_gem_context_reset_stats_ioctl
	.p2align	4, 0x90
_i915_gem_context_reset_stats_ioctl:    ## @i915_gem_context_reset_stats_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r14
	callq	_to_i915
	cmpq	$0, 40(%r14)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 32(%r14)
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rax, %r15
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_rcu_read_lock
	movl	(%r12), %edi
	movl	24(%r14), %esi
	callq	___i915_gem_context_lookup_rcu
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	%rax, %r12
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r15, %rdi
	callq	_i915_reset_count
	jmp	LBB0_7
LBB0_5:
	xorl	%eax, %eax
LBB0_7:
	movq	%rax, 16(%r14)
	movq	%r12, %rdi
	addq	$4, %rdi
	callq	_atomic_read
	movq	%rax, 8(%r14)
	movq	%r12, %rdi
	callq	_atomic_read
	movq	%rax, (%r14)
LBB0_8:
	xorl	%eax, %eax
	callq	_rcu_read_unlock
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_context_reset_stats_ioctl ; -- Begin function i915_gem_context_reset_stats_ioctl
	.p2align	2
_i915_gem_context_reset_stats_ioctl:    ; @i915_gem_context_reset_stats_ioctl
	.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, x2
	mov	x19, x1
	bl	_to_i915
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_3:
	mov	x0, x20
	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_4:
	mov	x21, x0
Lloh3:
	adrp	x8, _ENOENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	bl	_rcu_read_lock
	ldr	w0, [x20]
	ldr	w1, [x19, #24]
	bl	___i915_gem_context_lookup_rcu
	cbz	x0, LBB0_8
; %bb.5:
	mov	x20, x0
Lloh6:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_capable
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_i915_reset_count
LBB0_7:
	str	x0, [x19, #16]
	add	x0, x20, #4
	bl	_atomic_read
	str	x0, [x19, #8]
	mov	x0, x20
	bl	_atomic_read
	mov	w20, #0
	str	x0, [x19]
	b	LBB0_9
LBB0_8:
	neg	w20, w22
LBB0_9:
	bl	_rcu_read_unlock
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
.subsections_via_symbols
