	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gen8_engine_reset_prepare
_gen8_engine_reset_prepare:             ## @gen8_engine_reset_prepare
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	4(%rdi), %edi
	callq	_RING_RESET_CTL
	movl	%eax, %r12d
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read_fw
	movq	_RESET_CTL_CAT_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	xorl	%edx, %edx
	movl	%ebx, %r13d
	movl	$0, %r14d
	testl	%eax, %ebx
	je	LBB0_1
LBB0_3:
	movl	%ebx, %edi
	callq	__MASKED_BIT_ENABLE
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_intel_uncore_write_fw
	movq	$0, (%rsp)
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	movl	$700, %r8d                      ## imm = 0x2BC
	xorl	%r9d, %r9d
	callq	___intel_wait_for_register_fw
	xorl	%edx, %edx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r14d
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_intel_uncore_read_fw
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_DRM_ERROR
	movl	%r13d, %edx
	jmp	LBB0_5
LBB0_1:
	movq	_RESET_CTL_READY_TO_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	testl	%eax, %r13d
	je	LBB0_2
LBB0_5:
	movl	%edx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_RESET_CTL_REQUEST_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r13d, %r14d
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_RESET_CTL_CAT_ERROR,4,2        ## @RESET_CTL_CAT_ERROR
	.comm	_RESET_CTL_READY_TO_RESET,4,2   ## @RESET_CTL_READY_TO_RESET
	.comm	_RESET_CTL_REQUEST_RESET,4,2    ## @RESET_CTL_REQUEST_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s reset request timed out: {request: %08x, RESET_CTL: %08x}\n"

	.no_dead_strip	_gen8_engine_reset_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gen8_engine_reset_prepare
_gen8_engine_reset_prepare:             ; @gen8_engine_reset_prepare
	.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	x20, x0
	ldr	x19, [x0, #8]
	ldr	w0, [x0, #4]
	bl	_RING_RESET_CTL
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_intel_uncore_read_fw
Lloh0:
	adrp	x8, _RESET_CTL_CAT_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RESET_CTL_CAT_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	tst	w22, w0
	b.eq	LBB0_4
; %bb.1:
	mov	w24, #0
	mov	x23, x22
LBB0_2:
	mov	x0, x22
	bl	__MASKED_BIT_ENABLE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_intel_uncore_write_fw
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x24
	mov	w4, #700
	mov	w5, #0
	mov	x6, #0
	bl	___intel_wait_for_register_fw
	mov	x23, x0
	cbz	w0, LBB0_6
; %bb.3:
	ldr	w20, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_intel_uncore_read_fw
	mov	x3, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x22
	bl	_DRM_ERROR
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x8, _RESET_CTL_READY_TO_RESET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RESET_CTL_READY_TO_RESET@GOTPAGEOFF]
Lloh7:
	ldr	w23, [x8]
	tst	w23, w0
	b.eq	LBB0_7
; %bb.5:
	mov	w23, #0
LBB0_6:
	mov	x0, x23
	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_7:
Lloh8:
	adrp	x8, _RESET_CTL_REQUEST_RESET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RESET_CTL_REQUEST_RESET@GOTPAGEOFF]
Lloh10:
	ldr	w22, [x8]
	mov	x24, x23
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RESET_CTL_CAT_ERROR,4,2        ; @RESET_CTL_CAT_ERROR
	.comm	_RESET_CTL_READY_TO_RESET,4,2   ; @RESET_CTL_READY_TO_RESET
	.comm	_RESET_CTL_REQUEST_RESET,4,2    ; @RESET_CTL_REQUEST_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s reset request timed out: {request: %08x, RESET_CTL: %08x}\n"

	.no_dead_strip	_gen8_engine_reset_prepare
.subsections_via_symbols
