	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_set_hwcg                  ## -- Begin function a5xx_set_hwcg
	.p2align	4, 0x90
_a5xx_set_hwcg:                         ## @a5xx_set_hwcg
	.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
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_to_adreno_gpu
	movq	%rax, %r15
	movq	_a5xx_hwcg@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%rax,%rbx,8), %esi
	movq	%r14, %rdi
	callq	_gpu_write
	incq	%rbx
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %rbx
	jae	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	$0, %edx
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax,%rbx,8), %edx
	jmp	LBB0_4
LBB0_5:
	movq	%r15, %rdi
	callq	_adreno_is_a540
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_REG_A5XX_RBBM_CLOCK_DELAY_GPMU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	setne	%r15b
	movl	$1904, %edx                     ## imm = 0x770
	cmovel	%r12d, %edx
	movq	%r14, %rdi
	callq	_gpu_write
	movq	_REG_A5XX_RBBM_CLOCK_HYST_GPMU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$2, %r15d
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_gpu_write
LBB0_7:
	movq	_REG_A5XX_RBBM_CLOCK_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	setne	%bl
	movl	$-1431787008, %edx              ## imm = 0xAAA8AA00
	cmovel	%r12d, %edx
	movq	%r14, %rdi
	callq	_gpu_write
	movq	_REG_A5XX_RBBM_ISDB_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	(%rbx,%rbx), %edx
	addl	$384, %edx                      ## imm = 0x180
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gpu_write                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_a5xx_hwcg,8,3                  ## @a5xx_hwcg
	.comm	_REG_A5XX_RBBM_CLOCK_DELAY_GPMU,4,2 ## @REG_A5XX_RBBM_CLOCK_DELAY_GPMU
	.comm	_REG_A5XX_RBBM_CLOCK_HYST_GPMU,4,2 ## @REG_A5XX_RBBM_CLOCK_HYST_GPMU
	.comm	_REG_A5XX_RBBM_CLOCK_CNTL,4,2   ## @REG_A5XX_RBBM_CLOCK_CNTL
	.comm	_REG_A5XX_RBBM_ISDB_CNT,4,2     ## @REG_A5XX_RBBM_ISDB_CNT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_set_hwcg                  ; -- Begin function a5xx_set_hwcg
	.p2align	2
_a5xx_set_hwcg:                         ; @a5xx_set_hwcg
	.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, x1
	mov	x19, x0
	bl	_to_adreno_gpu
	mov	x21, x0
Lloh0:
	adrp	x22, _a5xx_hwcg@GOTPAGE
Lloh1:
	ldr	x22, [x22, _a5xx_hwcg@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_6
; %bb.1:
	mov	x23, #0
	mov	x24, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x8, x23]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, x23
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_gpu_write
	add	x24, x24, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	add	x23, x23, #8
	cmp	x24, w0, uxtw
	b.hs	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	cbnz	w20, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w2, #0
	b	LBB0_3
LBB0_6:
	mov	x0, x21
	bl	_adreno_is_a540
	cbz	x0, LBB0_8
; %bb.7:
Lloh2:
	adrp	x8, _REG_A5XX_RBBM_CLOCK_DELAY_GPMU@GOTPAGE
Lloh3:
	ldr	x8, [x8, _REG_A5XX_RBBM_CLOCK_DELAY_GPMU@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w8, #1904
	cmp	w20, #0
	csel	w2, wzr, w8, eq
	cset	w21, ne
	mov	x0, x19
	bl	_gpu_write
Lloh5:
	adrp	x8, _REG_A5XX_RBBM_CLOCK_HYST_GPMU@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_A5XX_RBBM_CLOCK_HYST_GPMU@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	lsl	w2, w21, #2
	mov	x0, x19
	bl	_gpu_write
LBB0_8:
Lloh8:
	adrp	x8, _REG_A5XX_RBBM_CLOCK_CNTL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REG_A5XX_RBBM_CLOCK_CNTL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w8, #43520
	movk	w8, #43688, lsl #16
	cmp	w20, #0
	csel	w2, wzr, w8, eq
	mov	w8, #386
	mov	w9, #384
	csel	w20, w9, w8, eq
	mov	x0, x19
	bl	_gpu_write
Lloh11:
	adrp	x8, _REG_A5XX_RBBM_ISDB_CNT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_A5XX_RBBM_ISDB_CNT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	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
	b	_gpu_write
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_a5xx_hwcg,8,3                  ; @a5xx_hwcg
	.comm	_REG_A5XX_RBBM_CLOCK_DELAY_GPMU,4,2 ; @REG_A5XX_RBBM_CLOCK_DELAY_GPMU
	.comm	_REG_A5XX_RBBM_CLOCK_HYST_GPMU,4,2 ; @REG_A5XX_RBBM_CLOCK_HYST_GPMU
	.comm	_REG_A5XX_RBBM_CLOCK_CNTL,4,2   ; @REG_A5XX_RBBM_CLOCK_CNTL
	.comm	_REG_A5XX_RBBM_ISDB_CNT,4,2     ; @REG_A5XX_RBBM_ISDB_CNT
.subsections_via_symbols
