	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a6xx_gmu_resume                ## -- Begin function a6xx_gmu_resume
	.p2align	4, 0x90
_a6xx_gmu_resume:                       ## @a6xx_gmu_resume
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%edi, %edi
	cmpl	$0, 40(%r14)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_12
## %bb.1:
	movl	$0, (%r14)
	movl	4(%r14), %edi
	callq	_pm_runtime_get_sync
	movl	36(%r14), %edi
	movl	$200000000, %esi                ## imm = 0xBEBC200
	callq	_clk_set_rate
	movl	28(%r14), %esi
	movl	32(%r14), %edi
	callq	_clk_bulk_prepare_enable
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_3:
	movl	48(%r14), %ebx
	movl	$3072, %edi                     ## imm = 0xC00
	callq	_MBps_to_icc
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_icc_set_bw
	movq	_REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_gmu_write
	movq	_REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_A6XX_GMU_IRQ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	movq	%r14, %rdi
	callq	_gmu_write
	movl	8(%r14), %edi
	callq	_enable_irq
	movq	_REG_A6XX_GMU_GENERAL_7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_gmu_read
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.5:
	movq	_GMU_WARM_BOOT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_GMU_COLD_BOOT@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %r15d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_a6xx_gmu_fw_start
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_a6xx_hfi_start
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_8
LBB0_10:
	movl	8(%r14), %edi
	callq	_disable_irq
	movq	%r14, %rdi
	callq	_a6xx_rpmh_stop
LBB0_11:
	movl	4(%r14), %edi
	callq	_pm_runtime_put
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_REG_A6XX_GMU_GMU2HOST_INTR_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_gmu_write
	movq	_REG_A6XX_GMU_GMU2HOST_INTR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_A6XX_HFI_IRQ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	movq	%r14, %rdi
	callq	_gmu_write
	movl	24(%r14), %edi
	callq	_enable_irq
	movq	16(%r14), %rsi
	decq	%rsi
	movq	%r14, %rdi
	callq	___a6xx_gmu_set_freq
	movl	12(%r14), %edi
	callq	_IS_ERR_OR_NULL
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movl	12(%r14), %edi
	callq	_pm_runtime_get
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"The GMU is not set up yet\n"

	.comm	_REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR,4,2 ## @REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR
	.comm	_REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK,4,2 ## @REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK
	.comm	_A6XX_GMU_IRQ_MASK,4,2          ## @A6XX_GMU_IRQ_MASK
	.comm	_REG_A6XX_GMU_GENERAL_7,4,2     ## @REG_A6XX_GMU_GENERAL_7
	.comm	_GMU_WARM_BOOT,4,2              ## @GMU_WARM_BOOT
	.comm	_GMU_COLD_BOOT,4,2              ## @GMU_COLD_BOOT
	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_CLR,4,2 ## @REG_A6XX_GMU_GMU2HOST_INTR_CLR
	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_MASK,4,2 ## @REG_A6XX_GMU_GMU2HOST_INTR_MASK
	.comm	_A6XX_HFI_IRQ_MASK,4,2          ## @A6XX_HFI_IRQ_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a6xx_gmu_resume                ; -- Begin function a6xx_gmu_resume
	.p2align	2
_a6xx_gmu_resume:                       ; @a6xx_gmu_resume
	.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
	ldr	w8, [x0, #40]
	cmp	w8, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	cbz	x0, LBB0_2
LBB0_1:
	mov	w20, #0
	b	LBB0_8
LBB0_2:
	str	wzr, [x19]
	ldr	w0, [x19, #4]
	bl	_pm_runtime_get_sync
	ldr	w0, [x19, #36]
	mov	w1, #49664
	movk	w1, #3051, lsl #16
	bl	_clk_set_rate
	ldp	w1, w0, [x19, #28]
	bl	_clk_bulk_prepare_enable
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
	b	LBB0_7
LBB0_4:
	ldr	w20, [x19, #48]
	mov	w0, #3072
	bl	_MBps_to_icc
	mov	x2, x0
	mov	x0, x20
	mov	w1, #0
	bl	_icc_set_bw
Lloh2:
	adrp	x8, _REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_gmu_write
Lloh5:
	adrp	x8, _REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _A6XX_GMU_IRQ_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _A6XX_GMU_IRQ_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mvn	w2, w8
	mov	x0, x19
	bl	_gmu_write
	ldr	w0, [x19, #8]
	bl	_enable_irq
Lloh11:
	adrp	x8, _REG_A6XX_GMU_GENERAL_7@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_A6XX_GMU_GENERAL_7@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_gmu_read
Lloh14:
	adrp	x8, _GMU_WARM_BOOT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GMU_WARM_BOOT@GOTPAGEOFF]
Lloh16:
	adrp	x9, _GMU_COLD_BOOT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _GMU_COLD_BOOT@GOTPAGEOFF]
	cmp	w0, #1
	csel	x8, x8, x9, eq
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_a6xx_gmu_fw_start
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x1, x21
	bl	_a6xx_hfi_start
	mov	x20, x0
	cbz	w0, LBB0_9
LBB0_6:
	ldr	w0, [x19, #8]
	bl	_disable_irq
	mov	x0, x19
	bl	_a6xx_rpmh_stop
LBB0_7:
	ldr	w0, [x19, #4]
	bl	_pm_runtime_put
LBB0_8:
	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
LBB0_9:
Lloh18:
	adrp	x8, _REG_A6XX_GMU_GMU2HOST_INTR_CLR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _REG_A6XX_GMU_GMU2HOST_INTR_CLR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_gmu_write
Lloh21:
	adrp	x8, _REG_A6XX_GMU_GMU2HOST_INTR_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _REG_A6XX_GMU_GMU2HOST_INTR_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _A6XX_HFI_IRQ_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _A6XX_HFI_IRQ_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	mvn	w2, w8
	mov	x0, x19
	bl	_gmu_write
	ldr	w0, [x19, #24]
	bl	_enable_irq
	ldr	x8, [x19, #16]
	sub	x1, x8, #1
	mov	x0, x19
	bl	___a6xx_gmu_set_freq
	ldr	w0, [x19, #12]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_1
; %bb.10:
	ldr	w0, [x19, #12]
	bl	_pm_runtime_get
	mov	w20, #0
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"The GMU is not set up yet\n"

	.comm	_REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR,4,2 ; @REG_A6XX_GMU_AO_HOST_INTERRUPT_CLR
	.comm	_REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK,4,2 ; @REG_A6XX_GMU_AO_HOST_INTERRUPT_MASK
	.comm	_A6XX_GMU_IRQ_MASK,4,2          ; @A6XX_GMU_IRQ_MASK
	.comm	_REG_A6XX_GMU_GENERAL_7,4,2     ; @REG_A6XX_GMU_GENERAL_7
	.comm	_GMU_WARM_BOOT,4,2              ; @GMU_WARM_BOOT
	.comm	_GMU_COLD_BOOT,4,2              ; @GMU_COLD_BOOT
	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_CLR,4,2 ; @REG_A6XX_GMU_GMU2HOST_INTR_CLR
	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_MASK,4,2 ; @REG_A6XX_GMU_GMU2HOST_INTR_MASK
	.comm	_A6XX_HFI_IRQ_MASK,4,2          ; @A6XX_HFI_IRQ_MASK
.subsections_via_symbols
