	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_do_reset
_g4x_do_reset:                          ## @g4x_do_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	(%rdi), %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movq	_VDECCLK_GATE_D@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_VCP_UNIT_CLOCK_GATE_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_rmw_set_fw
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_intel_uncore_posting_read_fw
	movq	_I915_GDRST@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_GRDOM_MEDIA@GOTPCREL(%rip), %rax
	movq	_GRDOM_RESET_ENABLE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_pci_write_config_byte
	movq	%r15, %rdi
	callq	_g4x_reset_complete
	movl	%eax, %edi
	movl	$50, %esi
	callq	_wait_for_atomic
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_2:
	movl	(%r12), %esi
	movq	_GRDOM_RENDER@GOTPCREL(%rip), %rax
	movl	(%r13), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_pci_write_config_byte
	movq	%r15, %rdi
	callq	_g4x_reset_complete
	movl	%eax, %edi
	movl	$50, %esi
	callq	_wait_for_atomic
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movq	_I915_GDRST@GOTPCREL(%rip), %r12
LBB0_4:
	callq	_DRM_DEBUG_DRIVER
LBB0_5:
	movl	(%r12), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_pci_write_config_byte
	movq	_VDECCLK_GATE_D@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_VCP_UNIT_CLOCK_GATE_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_rmw_clear_fw
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_intel_uncore_posting_read_fw
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	movq	_I915_GDRST@GOTPCREL(%rip), %r12
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_VDECCLK_GATE_D,4,2             ## @VDECCLK_GATE_D
	.comm	_VCP_UNIT_CLOCK_GATE_DISABLE,4,2 ## @VCP_UNIT_CLOCK_GATE_DISABLE
	.comm	_I915_GDRST,4,2                 ## @I915_GDRST
	.comm	_GRDOM_MEDIA,4,2                ## @GRDOM_MEDIA
	.comm	_GRDOM_RESET_ENABLE,4,2         ## @GRDOM_RESET_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait for media reset failed\n"

	.comm	_GRDOM_RENDER,4,2               ## @GRDOM_RENDER
L_.str.1:                               ## @.str.1
	.asciz	"Wait for render reset failed\n"

	.no_dead_strip	_g4x_do_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_do_reset
_g4x_do_reset:                          ; @g4x_do_reset
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldp	x19, x8, [x0]
	ldr	x20, [x8]
Lloh0:
	adrp	x22, _VDECCLK_GATE_D@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VDECCLK_GATE_D@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x23, _VCP_UNIT_CLOCK_GATE_DISABLE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _VCP_UNIT_CLOCK_GATE_DISABLE@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_rmw_set_fw
	ldr	w1, [x22]
	mov	x0, x19
	bl	_intel_uncore_posting_read_fw
Lloh4:
	adrp	x24, _I915_GDRST@GOTPAGE
Lloh5:
	ldr	x24, [x24, _I915_GDRST@GOTPAGEOFF]
Lloh6:
	adrp	x8, _GRDOM_MEDIA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GRDOM_MEDIA@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x25, _GRDOM_RESET_ENABLE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _GRDOM_RESET_ENABLE@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_pci_write_config_byte
	mov	x0, x20
	bl	_g4x_reset_complete
	mov	w1, #50
	bl	_wait_for_atomic
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	w1, [x24]
Lloh13:
	adrp	x8, _GRDOM_RENDER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GRDOM_RENDER@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x25]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_pci_write_config_byte
	mov	x0, x20
	bl	_g4x_reset_complete
	mov	w1, #50
	bl	_wait_for_atomic
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.3:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_DEBUG_DRIVER
LBB0_5:
	ldr	w1, [x24]
	mov	x0, x20
	mov	w2, #0
	bl	_pci_write_config_byte
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_rmw_clear_fw
	ldr	w1, [x22]
	mov	x0, x19
	bl	_intel_uncore_posting_read_fw
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_VDECCLK_GATE_D,4,2             ; @VDECCLK_GATE_D
	.comm	_VCP_UNIT_CLOCK_GATE_DISABLE,4,2 ; @VCP_UNIT_CLOCK_GATE_DISABLE
	.comm	_I915_GDRST,4,2                 ; @I915_GDRST
	.comm	_GRDOM_MEDIA,4,2                ; @GRDOM_MEDIA
	.comm	_GRDOM_RESET_ENABLE,4,2         ; @GRDOM_RESET_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait for media reset failed\n"

	.comm	_GRDOM_RENDER,4,2               ; @GRDOM_RENDER
l_.str.1:                               ; @.str.1
	.asciz	"Wait for render reset failed\n"

	.no_dead_strip	_g4x_do_reset
.subsections_via_symbols
