	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_device_lock_adev
_amdgpu_device_lock_adev:               ## @amdgpu_device_lock_adev
	.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
	movq	%rdi, %rbx
	addq	$12, %rdi
	testl	%esi, %esi
	je	LBB0_3
## %bb.1:
	callq	_mutex_trylock
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_3:
	callq	_mutex_lock
LBB0_4:
	leaq	8(%rbx), %rdi
	callq	_atomic_inc
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_amdgpu_asic_reset_method
	cmpl	$128, %eax
	jne	LBB0_5
## %bb.6:
	movq	_PP_MP1_STATE_RESET@GOTPCREL(%rip), %rcx
	cmpl	$129, %eax
	je	LBB0_8
	jmp	LBB0_9
LBB0_5:
	movq	_PP_MP1_STATE_NONE@GOTPCREL(%rip), %rcx
	cmpl	$129, %eax
	jne	LBB0_9
LBB0_8:
	movq	_PP_MP1_STATE_SHUTDOWN@GOTPCREL(%rip), %rcx
LBB0_9:
	movl	(%rcx), %eax
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	_amdgpu_sriov_vf
	movl	$1, %r14d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_amdgpu_amdkfd_pre_reset
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PP_MP1_STATE_SHUTDOWN,4,2      ## @PP_MP1_STATE_SHUTDOWN
	.comm	_PP_MP1_STATE_RESET,4,2         ## @PP_MP1_STATE_RESET
	.comm	_PP_MP1_STATE_NONE,4,2          ## @PP_MP1_STATE_NONE
	.no_dead_strip	_amdgpu_device_lock_adev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_device_lock_adev
_amdgpu_device_lock_adev:               ; @amdgpu_device_lock_adev
	.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
	mov	x19, x0
	add	x0, x0, #12
	cbz	w1, LBB0_3
; %bb.1:
	bl	_mutex_trylock
	cbnz	w0, LBB0_4
; %bb.2:
	mov	w20, #0
	b	LBB0_6
LBB0_3:
	bl	_mutex_lock
LBB0_4:
	add	x0, x19, #8
	bl	_atomic_inc
	mov	w20, #1
	str	w20, [x19]
	mov	x0, x19
	bl	_amdgpu_asic_reset_method
Lloh0:
	adrp	x8, _PP_MP1_STATE_SHUTDOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PP_MP1_STATE_SHUTDOWN@GOTPAGEOFF]
Lloh2:
	adrp	x9, _PP_MP1_STATE_RESET@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PP_MP1_STATE_RESET@GOTPAGEOFF]
Lloh4:
	adrp	x10, _PP_MP1_STATE_NONE@GOTPAGE
Lloh5:
	ldr	x10, [x10, _PP_MP1_STATE_NONE@GOTPAGEOFF]
	cmp	w0, #128
	csel	x9, x9, x10, eq
	cmp	w0, #129
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_amdgpu_amdkfd_pre_reset
	mov	w20, #1
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PP_MP1_STATE_SHUTDOWN,4,2      ; @PP_MP1_STATE_SHUTDOWN
	.comm	_PP_MP1_STATE_RESET,4,2         ; @PP_MP1_STATE_RESET
	.comm	_PP_MP1_STATE_NONE,4,2          ; @PP_MP1_STATE_NONE
	.no_dead_strip	_amdgpu_device_lock_adev
.subsections_via_symbols
