	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_device_pre_asic_reset
_amdgpu_device_pre_asic_reset:          ## @amdgpu_device_pre_asic_reset
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %r15d
	movq	_AMDGPU_MAX_RINGS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.1:
	xorl	%r14d, %r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rcx
	movq	(%rcx,%r14,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, (%rdi)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_amdgpu_fence_driver_force_completion
	movl	(%r13), %eax
	jmp	LBB0_5
LBB0_6:
	testq	%r12, %r12
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	callq	_drm_sched_increase_karma
LBB0_8:
	movq	%rbx, %rdi
	callq	_amdgpu_sriov_vf
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_17
## %bb.9:
	testl	%r15d, %r15d
	jne	LBB0_15
## %bb.10:
	movq	%rbx, %rdi
	callq	_amdgpu_device_ip_need_full_reset
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.11:
	movq	%rbx, %rdi
	callq	_amdgpu_device_ip_pre_soft_reset
	movq	%rbx, %rdi
	callq	_amdgpu_device_ip_soft_reset
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_amdgpu_device_ip_post_soft_reset
	testl	%r15d, %r15d
	jne	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	callq	_amdgpu_device_ip_check_soft_reset
	testq	%rax, %rax
	je	LBB0_13
LBB0_14:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_INFO
	movl	$1, %r15d
LBB0_15:
	movq	%rbx, %rdi
	callq	_amdgpu_device_ip_suspend
LBB0_16:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%r15d, (%rcx)
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_MAX_RINGS,4,2           ## @AMDGPU_MAX_RINGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"soft reset failed, will fallback to full reset!\n"

	.no_dead_strip	_amdgpu_device_pre_asic_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_device_pre_asic_reset
_amdgpu_device_pre_asic_reset:          ; @amdgpu_device_pre_asic_reset
	.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	x19, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w21, [x2]
Lloh0:
	adrp	x23, _AMDGPU_MAX_RINGS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AMDGPU_MAX_RINGS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x24, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x24, x24, #1
	cmp	x24, w8, sxtw
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20]
	ldr	x0, [x9, x24, lsl #3]
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x0]
	cbz	w9, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_amdgpu_fence_driver_force_completion
	ldr	w8, [x23]
	b	LBB0_2
LBB0_6:
	cbz	x22, LBB0_8
; %bb.7:
	mov	x0, x22
	bl	_drm_sched_increase_karma
LBB0_8:
	mov	x0, x20
	bl	_amdgpu_sriov_vf
	cbz	w0, LBB0_10
; %bb.9:
	mov	w0, #0
	b	LBB0_17
LBB0_10:
	cbnz	w21, LBB0_15
; %bb.11:
	mov	x0, x20
	bl	_amdgpu_device_ip_need_full_reset
	mov	x21, x0
	cbnz	w0, LBB0_15
; %bb.12:
	mov	x0, x20
	bl	_amdgpu_device_ip_pre_soft_reset
	mov	x0, x20
	bl	_amdgpu_device_ip_soft_reset
	mov	x21, x0
	mov	x0, x20
	bl	_amdgpu_device_ip_post_soft_reset
	cbnz	w21, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_amdgpu_device_ip_check_soft_reset
	cbz	x0, LBB0_18
LBB0_14:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
	mov	w21, #1
LBB0_15:
	mov	x0, x20
	bl	_amdgpu_device_ip_suspend
LBB0_16:
	str	w21, [x19]
LBB0_17:
	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_18:
	mov	w21, #0
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_MAX_RINGS,4,2           ; @AMDGPU_MAX_RINGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"soft reset failed, will fallback to full reset!\n"

	.no_dead_strip	_amdgpu_device_pre_asic_reset
.subsections_via_symbols
