	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a6xx_rpmh_start
_a6xx_rpmh_start:                       ## @a6xx_rpmh_start
	.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
	movq	%rdi, %rbx
	movq	_REG_A6XX_GMU_RSCC_CONTROL_REQ@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$2, %edx
	callq	_gmu_write
	xorl	%eax, %eax
	callq	_wmb
	movq	_REG_A6XX_GMU_RSCC_CONTROL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	movl	$10000, %r9d                    ## imm = 0x2710
	callq	_gmu_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_ERROR
	jmp	LBB0_5
LBB0_2:
	movq	_REG_A6XX_RSCC_SEQ_BUSY_DRV0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	movl	$10000, %r9d                    ## imm = 0x2710
	callq	_gmu_poll_timeout
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r15d
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movl	%r15d, %r14d
	jmp	LBB0_5
LBB0_4:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_gmu_write
	movq	_REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-16777216, %edx                ## imm = 0xFF000000
	callq	_gmu_write
	movq	_REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$255, %edx
	movl	$32, %ecx
	callq	_gmu_rmw
	movq	_REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_gmu_write
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_A6XX_GMU_RSCC_CONTROL_REQ,4,2 ## @REG_A6XX_GMU_RSCC_CONTROL_REQ
	.comm	_REG_A6XX_GMU_RSCC_CONTROL_ACK,4,2 ## @REG_A6XX_GMU_RSCC_CONTROL_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to power on the GPU RSC\n"

	.comm	_REG_A6XX_RSCC_SEQ_BUSY_DRV0,4,2 ## @REG_A6XX_RSCC_SEQ_BUSY_DRV0
L_.str.1:                               ## @.str.1
	.asciz	"GPU RSC sequence stuck while waking up the GPU\n"

	.comm	_REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK,4,2 ## @REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK
	.comm	_REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0,4,2 ## @REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0
	.comm	_REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE,4,2 ## @REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE
	.no_dead_strip	_a6xx_rpmh_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a6xx_rpmh_start
_a6xx_rpmh_start:                       ; @a6xx_rpmh_start
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _REG_A6XX_GMU_RSCC_CONTROL_REQ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _REG_A6XX_GMU_RSCC_CONTROL_REQ@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w2, #2
	bl	_gmu_write
	bl	_wmb
Lloh2:
	adrp	x8, _REG_A6XX_GMU_RSCC_CONTROL_ACK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _REG_A6XX_GMU_RSCC_CONTROL_ACK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #100
	mov	w5, #10000
	bl	_gmu_poll_timeout
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_5
LBB0_2:
Lloh7:
	adrp	x8, _REG_A6XX_RSCC_SEQ_BUSY_DRV0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _REG_A6XX_RSCC_SEQ_BUSY_DRV0@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #100
	mov	w5, #10000
	bl	_gmu_poll_timeout
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_5
LBB0_4:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_gmu_write
Lloh12:
	adrp	x8, _REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-16777216
	bl	_gmu_write
Lloh15:
	adrp	x8, _REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0@GOTPAGE
Lloh16:
	ldr	x8, [x8, _REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #255
	mov	w3, #32
	bl	_gmu_rmw
Lloh18:
	adrp	x8, _REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_gmu_write
LBB0_5:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_A6XX_GMU_RSCC_CONTROL_REQ,4,2 ; @REG_A6XX_GMU_RSCC_CONTROL_REQ
	.comm	_REG_A6XX_GMU_RSCC_CONTROL_ACK,4,2 ; @REG_A6XX_GMU_RSCC_CONTROL_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to power on the GPU RSC\n"

	.comm	_REG_A6XX_RSCC_SEQ_BUSY_DRV0,4,2 ; @REG_A6XX_RSCC_SEQ_BUSY_DRV0
l_.str.1:                               ; @.str.1
	.asciz	"GPU RSC sequence stuck while waking up the GPU\n"

	.comm	_REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK,4,2 ; @REG_A6XX_GPU_GMU_AO_GPU_CX_BUSY_MASK
	.comm	_REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0,4,2 ; @REG_A6XX_GMU_CX_GMU_POWER_COUNTER_SELECT_0
	.comm	_REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE,4,2 ; @REG_A6XX_GMU_CX_GMU_POWER_COUNTER_ENABLE
	.no_dead_strip	_a6xx_rpmh_start
.subsections_via_symbols
