	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_perfcnt_init          ## -- Begin function panfrost_perfcnt_init
	.p2align	4, 0x90
_panfrost_perfcnt_init:                 ## @panfrost_perfcnt_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_HW_FEATURE_V4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_panfrost_has_hw_feature
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	20(%r12), %edi
	callq	_hweight64
	movl	%eax, %ebx
	movq	_BLOCKS_PER_COREGROUP@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	jmp	LBB0_3
LBB0_2:
	movl	12(%r12), %r14d
	sarl	$8, %r14d
	movl	$3, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movl	%eax, %ebx
	andl	%r14d, %ebx
	movl	16(%r12), %edi
	callq	_fls64
                                        ## kill: def $eax killed $eax def $rax
	addl	%eax, %ebx
	addl	$3, %ebx
LBB0_3:
	movq	_COUNTERS_PER_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_BYTES_PER_COUNTER@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	8(%r12), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r14
	imull	%r15d, %ebx
	imull	%r13d, %ebx
	movq	%rbx, (%rax)
	movq	_GPU_PERFCNT_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_GPU_PERFCNT_CFG_MODE_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GPU_PERFCNT_CFG_MODE
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_gpu_write
	movq	_GPU_PRFCNT_JM_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_gpu_write
	movq	_GPU_PRFCNT_SHADER_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_gpu_write
	movq	_GPU_PRFCNT_MMU_L2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_gpu_write
	movq	_GPU_PRFCNT_TILER_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_gpu_write
	leaq	12(%r14), %rdi
	callq	_init_completion
	movq	%r14, %rdi
	addq	$8, %rdi
	callq	_mutex_init
	movq	%r14, (%r12)
	jmp	LBB0_6
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_FEATURE_V4,4,2              ## @HW_FEATURE_V4
	.comm	_BLOCKS_PER_COREGROUP,4,2       ## @BLOCKS_PER_COREGROUP
	.comm	_COUNTERS_PER_BLOCK,4,2         ## @COUNTERS_PER_BLOCK
	.comm	_BYTES_PER_COUNTER,4,2          ## @BYTES_PER_COUNTER
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GPU_PERFCNT_CFG,4,2            ## @GPU_PERFCNT_CFG
	.comm	_GPU_PERFCNT_CFG_MODE_OFF,4,2   ## @GPU_PERFCNT_CFG_MODE_OFF
	.comm	_GPU_PRFCNT_JM_EN,4,2           ## @GPU_PRFCNT_JM_EN
	.comm	_GPU_PRFCNT_SHADER_EN,4,2       ## @GPU_PRFCNT_SHADER_EN
	.comm	_GPU_PRFCNT_MMU_L2_EN,4,2       ## @GPU_PRFCNT_MMU_L2_EN
	.comm	_GPU_PRFCNT_TILER_EN,4,2        ## @GPU_PRFCNT_TILER_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_perfcnt_init          ; -- Begin function panfrost_perfcnt_init
	.p2align	2
_panfrost_perfcnt_init:                 ; @panfrost_perfcnt_init
	.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	x19, x0
Lloh0:
	adrp	x8, _HW_FEATURE_V4@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HW_FEATURE_V4@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_panfrost_has_hw_feature
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #20]
	bl	_hweight64
Lloh3:
	adrp	x8, _BLOCKS_PER_COREGROUP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BLOCKS_PER_COREGROUP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mul	w21, w8, w0
	b	LBB0_3
LBB0_2:
	ldr	w20, [x19, #12]
	mov	w0, #3
	mov	w1, #0
	bl	_GENMASK
	and	w20, w0, w20, asr #8
	ldr	w0, [x19, #16]
	bl	_fls64
	add	w8, w20, w0
	add	w21, w8, #3
LBB0_3:
Lloh6:
	adrp	x8, _COUNTERS_PER_BLOCK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _COUNTERS_PER_BLOCK@GOTPAGEOFF]
Lloh8:
	adrp	x9, _BYTES_PER_COUNTER@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BYTES_PER_COUNTER@GOTPAGEOFF]
Lloh10:
	ldr	w23, [x8]
Lloh11:
	ldr	w22, [x9]
	ldr	w0, [x19, #8]
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_devm_kzalloc
	cbz	x0, LBB0_5
; %bb.4:
	mov	x20, x0
	mul	w8, w21, w23
	mul	w8, w8, w22
	str	x8, [x0]
Lloh15:
	adrp	x8, _GPU_PERFCNT_CFG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GPU_PERFCNT_CFG@GOTPAGEOFF]
Lloh17:
	ldr	w21, [x8]
Lloh18:
	adrp	x8, _GPU_PERFCNT_CFG_MODE_OFF@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GPU_PERFCNT_CFG_MODE_OFF@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_GPU_PERFCNT_CFG_MODE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_gpu_write
Lloh21:
	adrp	x8, _GPU_PRFCNT_JM_EN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GPU_PRFCNT_JM_EN@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_gpu_write
Lloh24:
	adrp	x8, _GPU_PRFCNT_SHADER_EN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GPU_PRFCNT_SHADER_EN@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_gpu_write
Lloh27:
	adrp	x8, _GPU_PRFCNT_MMU_L2_EN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _GPU_PRFCNT_MMU_L2_EN@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_gpu_write
Lloh30:
	adrp	x8, _GPU_PRFCNT_TILER_EN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _GPU_PRFCNT_TILER_EN@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_gpu_write
	add	x0, x20, #12
	bl	_init_completion
	add	x0, x20, #8
	bl	_mutex_init
	mov	w0, #0
	str	x20, [x19]
	b	LBB0_6
LBB0_5:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_FEATURE_V4,4,2              ; @HW_FEATURE_V4
	.comm	_BLOCKS_PER_COREGROUP,4,2       ; @BLOCKS_PER_COREGROUP
	.comm	_COUNTERS_PER_BLOCK,4,2         ; @COUNTERS_PER_BLOCK
	.comm	_BYTES_PER_COUNTER,4,2          ; @BYTES_PER_COUNTER
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GPU_PERFCNT_CFG,4,2            ; @GPU_PERFCNT_CFG
	.comm	_GPU_PERFCNT_CFG_MODE_OFF,4,2   ; @GPU_PERFCNT_CFG_MODE_OFF
	.comm	_GPU_PRFCNT_JM_EN,4,2           ; @GPU_PRFCNT_JM_EN
	.comm	_GPU_PRFCNT_SHADER_EN,4,2       ; @GPU_PRFCNT_SHADER_EN
	.comm	_GPU_PRFCNT_MMU_L2_EN,4,2       ; @GPU_PRFCNT_MMU_L2_EN
	.comm	_GPU_PRFCNT_TILER_EN,4,2        ; @GPU_PRFCNT_TILER_EN
.subsections_via_symbols
