	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_clean_caches               ## -- Begin function v3d_clean_caches
	.p2align	4, 0x90
_v3d_clean_caches:                      ## @v3d_clean_caches
	.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, %r15
	addq	$4, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_trace_v3d_cache_clean_begin
	movq	_V3D_CTL_L2TCACTL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_V3D_L2TCACTL_TMUWCF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%edi, %edi
	callq	_V3D_CORE_WRITE
	movl	(%r13), %esi
	xorl	%edi, %edi
	callq	_V3D_CORE_READ
	movq	_V3D_L2TCACTL_L2TFLS@GOTPCREL(%rip), %r14
	xorl	%edi, %edi
	andl	(%r14), %eax
	sete	%dil
	movl	$100, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_2:
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	(%r13), %r12d
	movl	(%r14), %ebx
	movq	_V3D_L2TCACTL_FLM_CLEAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_V3D_L2TCACTL_FLM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_V3D_SET_FIELD
	orl	%eax, %ebx
	xorl	%edi, %edi
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_V3D_CORE_WRITE
	movl	(%r13), %esi
	xorl	%edi, %edi
	callq	_V3D_CORE_READ
	xorl	%edi, %edi
	andl	(%r14), %eax
	sete	%dil
	movl	$100, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_4:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trace_v3d_cache_clean_end      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_V3D_CTL_L2TCACTL,4,2           ## @V3D_CTL_L2TCACTL
	.comm	_V3D_L2TCACTL_TMUWCF,4,2        ## @V3D_L2TCACTL_TMUWCF
	.comm	_V3D_L2TCACTL_L2TFLS,4,2        ## @V3D_L2TCACTL_L2TFLS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout waiting for L1T write combiner flush\n"

	.comm	_V3D_L2TCACTL_FLM_CLEAN,4,2     ## @V3D_L2TCACTL_FLM_CLEAN
	.comm	_V3D_L2TCACTL_FLM,4,2           ## @V3D_L2TCACTL_FLM
L_.str.1:                               ## @.str.1
	.asciz	"Timeout waiting for L2T clean\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_clean_caches               ; -- Begin function v3d_clean_caches
	.p2align	2
_v3d_clean_caches:                      ; @v3d_clean_caches
	.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, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_trace_v3d_cache_clean_begin
Lloh0:
	adrp	x22, _V3D_CTL_L2TCACTL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _V3D_CTL_L2TCACTL@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _V3D_L2TCACTL_TMUWCF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _V3D_L2TCACTL_TMUWCF@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w0, #0
	bl	_V3D_CORE_WRITE
	ldr	w1, [x22]
	mov	w0, #0
	bl	_V3D_CORE_READ
Lloh5:
	adrp	x23, _V3D_L2TCACTL_L2TFLS@GOTPAGE
Lloh6:
	ldr	x23, [x23, _V3D_L2TCACTL_L2TFLS@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #100
	bl	_wait_for
	cbz	x0, LBB0_2
; %bb.1:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_2:
	mov	x0, x20
	bl	_mutex_lock
	ldr	w21, [x22]
	ldr	w24, [x23]
Lloh9:
	adrp	x8, _V3D_L2TCACTL_FLM_CLEAN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V3D_L2TCACTL_FLM_CLEAN@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _V3D_L2TCACTL_FLM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V3D_L2TCACTL_FLM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_V3D_SET_FIELD
	orr	w2, w0, w24
	mov	w0, #0
	mov	x1, x21
	bl	_V3D_CORE_WRITE
	ldr	w1, [x22]
	mov	w0, #0
	bl	_V3D_CORE_READ
	ldr	w8, [x23]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #100
	bl	_wait_for
	cbz	x0, LBB0_4
; %bb.3:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_4:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	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	_trace_v3d_cache_clean_end
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_V3D_CTL_L2TCACTL,4,2           ; @V3D_CTL_L2TCACTL
	.comm	_V3D_L2TCACTL_TMUWCF,4,2        ; @V3D_L2TCACTL_TMUWCF
	.comm	_V3D_L2TCACTL_L2TFLS,4,2        ; @V3D_L2TCACTL_L2TFLS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout waiting for L1T write combiner flush\n"

	.comm	_V3D_L2TCACTL_FLM_CLEAN,4,2     ; @V3D_L2TCACTL_FLM_CLEAN
	.comm	_V3D_L2TCACTL_FLM,4,2           ; @V3D_L2TCACTL_FLM
l_.str.1:                               ; @.str.1
	.asciz	"Timeout waiting for L2T clean\n"

.subsections_via_symbols
