	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_ctx_query
_amdgpu_ctx_query:                      ## @amdgpu_ctx_query
	.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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	%rsi, %rdi
	callq	_mutex_lock
	leaq	4(%rbx), %rdi
	movl	%r15d, %esi
	callq	_idr_find
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	$0, (%r14)
	movq	%r12, %rdi
	callq	_atomic_read
	cmpl	%eax, (%r15)
	jne	LBB0_5
## %bb.6:
	movq	_AMDGPU_CTX_NO_RESET@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_3:
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_5:
	movq	_AMDGPU_CTX_UNKNOWN_RESET@GOTPCREL(%rip), %rcx
LBB0_7:
	movl	(%rcx), %ecx
	movl	%ecx, 8(%r14)
	movl	%eax, (%r15)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AMDGPU_CTX_NO_RESET,4,2        ## @AMDGPU_CTX_NO_RESET
	.comm	_AMDGPU_CTX_UNKNOWN_RESET,4,2   ## @AMDGPU_CTX_UNKNOWN_RESET
	.no_dead_strip	_amdgpu_ctx_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_ctx_query
_amdgpu_ctx_query:                      ; @amdgpu_ctx_query
	.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
	cbz	x1, LBB0_4
; %bb.1:
	mov	x20, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
	mov	x0, x1
	bl	_mutex_lock
	add	x0, x19, #4
	mov	x1, x22
	bl	_idr_find
	cbz	x0, LBB0_3
; %bb.2:
	mov	x22, x0
	str	xzr, [x20]
	mov	x0, x21
	bl	_atomic_read
Lloh0:
	adrp	x8, _AMDGPU_CTX_NO_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_CTX_NO_RESET@GOTPAGEOFF]
Lloh2:
	adrp	x9, _AMDGPU_CTX_UNKNOWN_RESET@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AMDGPU_CTX_UNKNOWN_RESET@GOTPAGEOFF]
	ldr	w10, [x22]
	cmp	w10, w0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x20, #8]
	str	w0, [x22]
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_4:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AMDGPU_CTX_NO_RESET,4,2        ; @AMDGPU_CTX_NO_RESET
	.comm	_AMDGPU_CTX_UNKNOWN_RESET,4,2   ; @AMDGPU_CTX_UNKNOWN_RESET
	.no_dead_strip	_amdgpu_ctx_query
.subsections_via_symbols
