	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_gpmu_ucode_init           ## -- Begin function a5xx_gpmu_ucode_init
	.p2align	4, 0x90
_a5xx_gpmu_ucode_init:                  ## @a5xx_gpmu_ucode_init
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	callq	_to_adreno_gpu
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_to_a5xx_gpu
	cmpq	$0, 8(%rax)
	jne	LBB0_30
## %bb.1:
	movq	%rax, %r10
	movq	(%rbx), %rax
	movq	_ADRENO_FW_GPMU@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rcx
	movl	(%rcx), %eax
	cmpl	$8, %eax
	jl	LBB0_30
## %bb.2:
	movq	8(%rcx), %rbx
	movl	(%rbx), %ecx
	cmpl	$2, %ecx
	jb	LBB0_30
## %bb.3:
	shrl	$2, %eax
	cmpl	%eax, %ecx
	jae	LBB0_30
## %bb.4:
	cmpl	$2, 4(%rbx)
	jne	LBB0_30
## %bb.5:
	movq	8(%r13), %rdi
	leaq	8(%r10), %r8
	movl	8(%rbx), %r12d
	subl	%r12d, %ecx
	leal	-2(%rcx), %r15d
	movq	_TYPE4_MAX_PAYLOAD@GOTPCREL(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	(%rsi)
                                        ## kill: def $eax killed $eax def $rax
	addl	%ecx, %eax
	addl	$-2, %eax
	leal	4(,%rax,4), %esi
	movq	_MSM_BO_UNCACHED@GOTPCREL(%rip), %rax
	movq	_MSM_BO_GPU_READONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	(%r13), %ecx
	leaq	16(%r10), %r9
	movq	%r10, -72(%rbp)                 ## 8-byte Spill
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	callq	_msm_gem_kernel_new_locked
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_30
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_msm_gem_object_set_name
	testl	%r15d, %r15d
	movq	_TYPE4_MAX_PAYLOAD@GOTPCREL(%rip), %r11
	je	LBB0_29
## %bb.7:
	movl	%r15d, %r10d
	leaq	(%rbx,%r12,4), %rbx
	addq	$12, %rbx
	leaq	112(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	movl	-48(%rbp), %r10d                ## 4-byte Reload
	movq	_TYPE4_MAX_PAYLOAD@GOTPCREL(%rip), %r11
LBB0_28:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	%r12d, %r15d
	subl	%r12d, %r10d
	je	LBB0_29
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
                                        ##     Child Loop BB0_19 Depth 2
                                        ##     Child Loop BB0_23 Depth 2
                                        ##     Child Loop BB0_27 Depth 2
	movl	(%r11), %r12d
	cmpl	%r12d, %r10d
	movl	%r10d, -48(%rbp)                ## 4-byte Spill
	cmovbl	%r10d, %r12d
	movq	_REG_A5XX_GPMU_INST_RAM_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%r15d, %edi
	movl	%r12d, %esi
	callq	_PKT4
	movslq	%r14d, %r14
	movl	%eax, (%r13,%r14,4)
	incl	%r14d
	testl	%r12d, %r12d
	jle	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movslq	%r14d, %r14
	leal	-1(%r12), %r8d
	xorl	%r9d, %r9d
	cmpl	$7, %r8d
	jb	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	(,%r14,4), %rcx
	addq	%r13, %rcx
	subq	%rbx, %rcx
	cmpq	$32, %rcx
	jae	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	-48(%rbp), %r10d                ## 4-byte Reload
	movq	_TYPE4_MAX_PAYLOAD@GOTPCREL(%rip), %r11
LBB0_21:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r12d, %edx
	subl	%r9d, %edx
	movl	%r9d, %ecx
	notl	%ecx
	addl	%r12d, %ecx
	andl	$3, %edx
	je	LBB0_25
## %bb.22:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	(,%r14,4), %rsi
	addq	%r13, %rsi
	negl	%edx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx), %eax
	addq	$4, %rbx
	movl	%eax, (%rsi)
	decq	%rdi
	addq	$4, %rsi
	cmpl	%edi, %edx
	jne	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_8 Depth=1
	subq	%rdi, %r14
	subl	%edi, %r9d
LBB0_25:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$3, %ecx
	jb	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%r12d, %ecx
	subl	%r9d, %ecx
	.p2align	4, 0x90
LBB0_27:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx), %eax
	movl	%eax, (%r13,%r14,4)
	movl	4(%rbx), %eax
	movl	%eax, 4(%r13,%r14,4)
	movl	8(%rbx), %eax
	movl	%eax, 8(%r13,%r14,4)
	movl	12(%rbx), %eax
	addq	$16, %rbx
	movl	%eax, 12(%r13,%r14,4)
	addq	$4, %r14
	addl	$-4, %ecx
	jne	LBB0_27
	jmp	LBB0_28
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r8
	movq	%r8, %r9
	andq	$-8, %r9
	leaq	-8(%r9), %rcx
	movq	%rcx, %rsi
	shrq	$3, %rsi
	incq	%rsi
	movl	%esi, %edx
	andl	$3, %edx
	cmpq	$24, %rcx
	jae	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%edi, %edi
	movl	-48(%rbp), %r10d                ## 4-byte Reload
	movq	_TYPE4_MAX_PAYLOAD@GOTPCREL(%rip), %r11
	jmp	LBB0_17
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	andq	$-4, %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,4), %rcx
	xorl	%edi, %edi
	movl	-48(%rbp), %r10d                ## 4-byte Reload
	movq	_TYPE4_MAX_PAYLOAD@GOTPCREL(%rip), %r11
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movups	(%rbx,%rdi,4), %xmm0
	movups	16(%rbx,%rdi,4), %xmm1
	movups	%xmm0, -112(%rcx,%rdi,4)
	movups	%xmm1, -96(%rcx,%rdi,4)
	movups	32(%rbx,%rdi,4), %xmm0
	movups	48(%rbx,%rdi,4), %xmm1
	movups	%xmm0, -80(%rcx,%rdi,4)
	movups	%xmm1, -64(%rcx,%rdi,4)
	movups	64(%rbx,%rdi,4), %xmm0
	movups	80(%rbx,%rdi,4), %xmm1
	movups	%xmm0, -48(%rcx,%rdi,4)
	movups	%xmm1, -32(%rcx,%rdi,4)
	movups	96(%rbx,%rdi,4), %xmm0
	movups	112(%rbx,%rdi,4), %xmm1
	movups	%xmm0, -16(%rcx,%rdi,4)
	movups	%xmm1, (%rcx,%rdi,4)
	addq	$32, %rdi
	addq	$-4, %rsi
	jne	LBB0_16
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	testq	%rdx, %rdx
	je	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	(%rdi,%r14), %rcx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rcx
	leaq	(%rbx,%rdi,4), %rsi
	addq	$16, %rsi
	shlq	$5, %rdx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movups	-16(%rsi,%rdi), %xmm0
	movups	(%rsi,%rdi), %xmm1
	movups	%xmm0, -16(%rcx,%rdi)
	movups	%xmm1, (%rcx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rdx
	jne	LBB0_19
LBB0_20:                                ##   in Loop: Header=BB0_8 Depth=1
	addq	%r9, %r14
	leaq	(%rbx,%r9,4), %rbx
	cmpq	%r9, %r8
	je	LBB0_28
	jmp	LBB0_21
LBB0_29:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rdi
	callq	_msm_gem_put_vaddr
	movl	%r14d, (%rbx)
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADRENO_FW_GPMU,8,3             ## @ADRENO_FW_GPMU
	.comm	_TYPE4_MAX_PAYLOAD,4,2          ## @TYPE4_MAX_PAYLOAD
	.comm	_MSM_BO_UNCACHED,4,2            ## @MSM_BO_UNCACHED
	.comm	_MSM_BO_GPU_READONLY,4,2        ## @MSM_BO_GPU_READONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpmufw"

	.comm	_REG_A5XX_GPMU_INST_RAM_BASE,4,2 ## @REG_A5XX_GPMU_INST_RAM_BASE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_gpmu_ucode_init           ; -- Begin function a5xx_gpmu_ucode_init
	.p2align	2
_a5xx_gpmu_ucode_init:                  ; @a5xx_gpmu_ucode_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	bl	_to_adreno_gpu
	mov	x22, x0
	bl	_to_a5xx_gpu
	mov	x21, x0
	ldr	x8, [x21, #8]!
	cbnz	x8, LBB0_20
; %bb.1:
Lloh0:
	adrp	x8, _ADRENO_FW_GPMU@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADRENO_FW_GPMU@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x9, x8, lsl #3]
	ldr	w9, [x8]
	cmp	w9, #8
	b.lt	LBB0_20
; %bb.2:
	ldr	x25, [x8, #8]
	ldr	w8, [x25]
	lsr	w9, w9, #2
	cmp	w8, #2
	ccmp	w8, w9, #2, hs
	b.hs	LBB0_20
; %bb.3:
	ldr	w9, [x25, #4]
	cmp	w9, #2
	b.ne	LBB0_20
; %bb.4:
	mov	x19, x0
	ldr	x0, [x20, #8]
	ldr	w26, [x25, #8]
	sub	w8, w8, w26
	sub	w22, w8, #2
Lloh3:
	adrp	x23, _TYPE4_MAX_PAYLOAD@GOTPAGE
Lloh4:
	ldr	x23, [x23, _TYPE4_MAX_PAYLOAD@GOTPAGEOFF]
	ldr	w8, [x23]
	udiv	w8, w22, w8
	add	w8, w22, w8
	lsl	w8, w8, #2
	add	w1, w8, #4
Lloh5:
	adrp	x8, _MSM_BO_UNCACHED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSM_BO_UNCACHED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _MSM_BO_GPU_READONLY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MSM_BO_GPU_READONLY@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
	ldr	w3, [x20]
	add	x5, x19, #16
	mov	x4, x21
	bl	_msm_gem_kernel_new_locked
	mov	x20, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_20
; %bb.5:
	ldr	x0, [x21]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_msm_gem_object_set_name
	mov	w27, #0
	cbz	w22, LBB0_19
; %bb.6:
	mov	w24, #0
	add	x8, x25, x26, lsl #2
	add	x28, x8, #12
	add	x25, x20, #32
Lloh13:
	adrp	x26, _REG_A5XX_GPMU_INST_RAM_BASE@GOTPAGE
Lloh14:
	ldr	x26, [x26, _REG_A5XX_GPMU_INST_RAM_BASE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w24, w21, w24
	subs	w22, w22, w21
	b.eq	LBB0_19
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
	ldr	w8, [x23]
	cmp	w22, w8
	csel	w21, w22, w8, lo
	ldr	w8, [x26]
	add	w0, w8, w24
	mov	x1, x21
	bl	_PKT4
	str	w0, [x20, w27, sxtw #2]
	add	w27, w27, #1
	subs	w8, w21, #1
	b.lt	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	sxtw	x11, w27
	cmp	w8, #15
	b.lo	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x9, x20, x11, lsl #2
	sub	x9, x9, x28
	cmp	x9, #64
	b.hs	LBB0_16
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	w9, #0
	mov	x27, x11
	mov	x8, x28
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	sub	w9, w21, w9
LBB0_14:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w10, [x8], #4
	str	w10, [x20, x27, lsl #2]
	add	x27, x27, #1
	subs	w9, w9, #1
	b.ne	LBB0_14
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x28, x8
	b	LBB0_8
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x10, x8, #1
	and	x9, x10, #0x1fffffff0
	add	x27, x9, x11
	add	x8, x28, x9, lsl #2
	add	x11, x25, x11, lsl #2
	add	x12, x28, #32
	mov	x13, x9
LBB0_17:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q0, q1, [x12, #-32]
	ldp	q2, q3, [x12], #64
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x13, x13, #16
	b.ne	LBB0_17
; %bb.18:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	x10, x9
	b.ne	LBB0_13
	b	LBB0_15
LBB0_19:
	ldr	x0, [x19, #8]
	bl	_msm_gem_put_vaddr
	str	w27, [x19]
LBB0_20:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ADRENO_FW_GPMU,8,3             ; @ADRENO_FW_GPMU
	.comm	_TYPE4_MAX_PAYLOAD,4,2          ; @TYPE4_MAX_PAYLOAD
	.comm	_MSM_BO_UNCACHED,4,2            ; @MSM_BO_UNCACHED
	.comm	_MSM_BO_GPU_READONLY,4,2        ; @MSM_BO_GPU_READONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpmufw"

	.comm	_REG_A5XX_GPMU_INST_RAM_BASE,4,2 ; @REG_A5XX_GPMU_INST_RAM_BASE
.subsections_via_symbols
