	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_perfcnt_enable_locked
_panfrost_perfcnt_enable_locked:        ## @panfrost_perfcnt_enable_locked
	.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	16(%r12), %rax
	cmpq	%rsi, %rax
	je	LBB0_1
## %bb.2:
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_1:
	xorl	%ebx, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%edx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	12(%rdi), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	8(%r14), %edi
	movl	28(%r12), %esi
	callq	_drm_gem_shmem_create
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.18:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_7:
	movq	%rbx, %rdi
	callq	_to_panfrost_bo
	movq	%rax, 8(%r12)
	movq	%rax, %rdi
	callq	_panfrost_mmu_map
	movq	%rbx, %rdi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	movq	%rdi, %rbx
	callq	_drm_gem_shmem_vmap
	movq	%rax, (%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	(%r12), %rdi
	callq	_PTR_ERR
	movq	%rbx, %rdi
	movl	%eax, %ebx
LBB0_10:
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_17
LBB0_11:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rdi
	addq	$24, %rdi
	callq	_reinit_completion
	movq	_GPU_INT_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GPU_IRQ_CLEAN_CACHES_COMPLETED@GOTPCREL(%rip), %rax
	movq	_GPU_IRQ_PERFCNT_SAMPLE_COMPLETED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_gpu_write
	movq	_GPU_CMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_GPU_CMD_PERFCNT_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_gpu_write
	movl	(%rbx), %esi
	movq	_GPU_CMD_CLEAN_INV_CACHES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_gpu_write
	movq	(%r14), %rbx
	addq	$24, %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movq	%r13, 16(%r12)
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_GPU_PERFCNT_CFG_AS
	movl	%eax, %r13d
	movq	_GPU_PERFCNT_CFG_MODE_MANUAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GPU_PERFCNT_CFG_MODE
	movl	%eax, %r12d
	orl	%r13d, %r12d
	movq	%r14, %rdi
	callq	_panfrost_model_is_bifrost
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movl	%r15d, %edi
	callq	_GPU_PERFCNT_CFG_SETSEL
	orl	%eax, %r12d
LBB0_15:
	movq	_GPU_PRFCNT_JM_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_gpu_write
	movq	_GPU_PRFCNT_SHADER_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_gpu_write
	movq	_GPU_PRFCNT_MMU_L2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_gpu_write
	movq	_HW_ISSUE_8186@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_panfrost_has_hw_issue
	movq	_GPU_PRFCNT_TILER_EN@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	cmpq	$1, %rax
	movl	$0, %edx
	sbbl	%edx, %edx
	movq	%r14, %rdi
	callq	_gpu_write
	movq	_GPU_PERFCNT_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_gpu_write
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_panfrost_has_hw_issue
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_gpu_write
	jmp	LBB0_17
LBB0_12:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	(%r12), %rsi
	movq	8(%r12), %rdi
	callq	_drm_gem_shmem_vunmap
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GPU_INT_CLEAR,4,2              ## @GPU_INT_CLEAR
	.comm	_GPU_IRQ_CLEAN_CACHES_COMPLETED,4,2 ## @GPU_IRQ_CLEAN_CACHES_COMPLETED
	.comm	_GPU_IRQ_PERFCNT_SAMPLE_COMPLETED,4,2 ## @GPU_IRQ_PERFCNT_SAMPLE_COMPLETED
	.comm	_GPU_CMD,4,2                    ## @GPU_CMD
	.comm	_GPU_CMD_PERFCNT_CLEAR,4,2      ## @GPU_CMD_PERFCNT_CLEAR
	.comm	_GPU_CMD_CLEAN_INV_CACHES,4,2   ## @GPU_CMD_CLEAN_INV_CACHES
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_GPU_PERFCNT_CFG_MODE_MANUAL,4,2 ## @GPU_PERFCNT_CFG_MODE_MANUAL
	.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	_HW_ISSUE_8186,4,2              ## @HW_ISSUE_8186
	.comm	_GPU_PRFCNT_TILER_EN,4,2        ## @GPU_PRFCNT_TILER_EN
	.comm	_GPU_PERFCNT_CFG,4,2            ## @GPU_PERFCNT_CFG
	.no_dead_strip	_panfrost_perfcnt_enable_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_perfcnt_enable_locked
_panfrost_perfcnt_enable_locked:        ; @panfrost_perfcnt_enable_locked
	.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
	ldr	x24, [x0]
	ldr	x8, [x24, #16]
	cmp	x8, x1
	b.eq	LBB0_16
; %bb.1:
	cbz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_3:
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0, #12]
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	w0, [x19, #8]
	ldr	w1, [x24, #28]
	bl	_drm_gem_shmem_create
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.5:
	mov	x0, x21
	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	_PTR_ERR
LBB0_6:
	mov	x23, x0
	b	LBB0_17
LBB0_7:
	mov	x0, x21
	bl	_to_panfrost_bo
	str	x0, [x24, #8]
	bl	_panfrost_mmu_map
	mov	x23, x0
	cbnz	w0, LBB0_10
; %bb.8:
	mov	x0, x21
	bl	_drm_gem_shmem_vmap
	str	x0, [x24]
	bl	_IS_ERR
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x0, [x24]
	bl	_PTR_ERR
	mov	x23, x0
LBB0_10:
	mov	x0, x21
	bl	_drm_gem_object_put_unlocked
	b	LBB0_17
LBB0_11:
	ldr	x8, [x19]
	add	x0, x8, #24
	bl	_reinit_completion
Lloh3:
	adrp	x8, _GPU_INT_CLEAR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPU_INT_CLEAR@GOTPAGEOFF]
Lloh5:
	adrp	x9, _GPU_IRQ_CLEAN_CACHES_COMPLETED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GPU_IRQ_CLEAN_CACHES_COMPLETED@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	ldr	w8, [x9]
Lloh9:
	adrp	x9, _GPU_IRQ_PERFCNT_SAMPLE_COMPLETED@GOTPAGE
Lloh10:
	ldr	x9, [x9, _GPU_IRQ_PERFCNT_SAMPLE_COMPLETED@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_gpu_write
Lloh12:
	adrp	x23, _GPU_CMD@GOTPAGE
Lloh13:
	ldr	x23, [x23, _GPU_CMD@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh14:
	adrp	x8, _GPU_CMD_PERFCNT_CLEAR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GPU_CMD_PERFCNT_CLEAR@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_gpu_write
	ldr	w1, [x23]
Lloh17:
	adrp	x8, _GPU_CMD_CLEAN_INV_CACHES@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GPU_CMD_CLEAN_INV_CACHES@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_gpu_write
	ldr	x8, [x19]
	add	x23, x8, #24
	mov	w0, #1000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x23
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_18
; %bb.12:
	str	x22, [x24, #16]
	mov	w0, #0
	bl	_GPU_PERFCNT_CFG_AS
	mov	x21, x0
Lloh20:
	adrp	x8, _GPU_PERFCNT_CFG_MODE_MANUAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GPU_PERFCNT_CFG_MODE_MANUAL@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_GPU_PERFCNT_CFG_MODE
	orr	w21, w0, w21
	mov	x0, x19
	bl	_panfrost_model_is_bifrost
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_GPU_PERFCNT_CFG_SETSEL
	orr	w21, w0, w21
LBB0_14:
Lloh23:
	adrp	x8, _GPU_PRFCNT_JM_EN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GPU_PRFCNT_JM_EN@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_gpu_write
Lloh26:
	adrp	x8, _GPU_PRFCNT_SHADER_EN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GPU_PRFCNT_SHADER_EN@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_gpu_write
Lloh29:
	adrp	x8, _GPU_PRFCNT_MMU_L2_EN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GPU_PRFCNT_MMU_L2_EN@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_gpu_write
Lloh32:
	adrp	x22, _HW_ISSUE_8186@GOTPAGE
Lloh33:
	ldr	x22, [x22, _HW_ISSUE_8186@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_panfrost_has_hw_issue
Lloh34:
	adrp	x20, _GPU_PRFCNT_TILER_EN@GOTPAGE
Lloh35:
	ldr	x20, [x20, _GPU_PRFCNT_TILER_EN@GOTPAGEOFF]
	ldr	w1, [x20]
	cmp	x0, #0
	csetm	w2, eq
	mov	x0, x19
	bl	_gpu_write
Lloh36:
	adrp	x8, _GPU_PERFCNT_CFG@GOTPAGE
Lloh37:
	ldr	x8, [x8, _GPU_PERFCNT_CFG@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_gpu_write
	ldr	w1, [x22]
	mov	x0, x19
	bl	_panfrost_has_hw_issue
	cbz	x0, LBB0_16
; %bb.15:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #-1
	bl	_gpu_write
LBB0_16:
	mov	w23, #0
LBB0_17:
	mov	x0, x23
	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
LBB0_18:
Lloh39:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w23, w8
	ldp	x1, x0, [x24]
	bl	_drm_gem_shmem_vunmap
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GPU_INT_CLEAR,4,2              ; @GPU_INT_CLEAR
	.comm	_GPU_IRQ_CLEAN_CACHES_COMPLETED,4,2 ; @GPU_IRQ_CLEAN_CACHES_COMPLETED
	.comm	_GPU_IRQ_PERFCNT_SAMPLE_COMPLETED,4,2 ; @GPU_IRQ_PERFCNT_SAMPLE_COMPLETED
	.comm	_GPU_CMD,4,2                    ; @GPU_CMD
	.comm	_GPU_CMD_PERFCNT_CLEAR,4,2      ; @GPU_CMD_PERFCNT_CLEAR
	.comm	_GPU_CMD_CLEAN_INV_CACHES,4,2   ; @GPU_CMD_CLEAN_INV_CACHES
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_GPU_PERFCNT_CFG_MODE_MANUAL,4,2 ; @GPU_PERFCNT_CFG_MODE_MANUAL
	.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	_HW_ISSUE_8186,4,2              ; @HW_ISSUE_8186
	.comm	_GPU_PRFCNT_TILER_EN,4,2        ; @GPU_PRFCNT_TILER_EN
	.comm	_GPU_PERFCNT_CFG,4,2            ; @GPU_PERFCNT_CFG
	.no_dead_strip	_panfrost_perfcnt_enable_locked
.subsections_via_symbols
