	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_preempt_trigger           ## -- Begin function a5xx_preempt_trigger
	.p2align	4, 0x90
_a5xx_preempt_trigger:                  ## @a5xx_preempt_trigger
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_adreno_gpu
	movq	%rax, %rdi
	callq	_to_a5xx_gpu
	cmpl	$1, (%rbx)
	je	LBB0_5
## %bb.1:
	movq	%rax, %r14
	movq	_PREEMPT_NONE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_PREEMPT_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_try_preempt_state
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	%rbx, %rdi
	callq	_get_next_ring
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %r15
	cmpq	%rax, 32(%r14)
	je	LBB0_6
## %bb.4:
	movq	%r15, %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_get_wptr
	movq	24(%r14), %rcx
	movq	(%r15), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movl	%eax, (%rcx)
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	_REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	16(%r14), %rax
	movq	(%r15), %rcx
	movl	(%rax,%rcx,4), %ecx
	movq	%rbx, %rdi
	callq	_gpu_write64
	movq	%r15, 8(%r14)
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movl	$10000, %edi                    ## imm = 0x2710
	callq	_msecs_to_jiffies
	addq	%rax, %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mod_timer
	movq	_PREEMPT_TRIGGERED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_set_preempt_state
	xorl	%eax, %eax
	callq	_wmb
	movq	_REG_A5XX_CP_CONTEXT_SWITCH_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gpu_write                      ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_PREEMPT_ABORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_set_preempt_state
	movq	32(%r14), %rsi
	movq	%rbx, %rdi
	callq	_update_wptr
	movl	(%r12), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_preempt_state              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PREEMPT_NONE,4,2               ## @PREEMPT_NONE
	.comm	_PREEMPT_START,4,2              ## @PREEMPT_START
	.comm	_PREEMPT_ABORT,4,2              ## @PREEMPT_ABORT
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO,4,2 ## @REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI,4,2 ## @REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_PREEMPT_TRIGGERED,4,2          ## @PREEMPT_TRIGGERED
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_CNTL,4,2 ## @REG_A5XX_CP_CONTEXT_SWITCH_CNTL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_preempt_trigger           ; -- Begin function a5xx_preempt_trigger
	.p2align	2
_a5xx_preempt_trigger:                  ; @a5xx_preempt_trigger
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_to_adreno_gpu
	bl	_to_a5xx_gpu
	ldr	w8, [x19]
	cmp	w8, #1
	b.eq	LBB0_5
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x22, _PREEMPT_NONE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PREEMPT_NONE@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _PREEMPT_START@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PREEMPT_START@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_try_preempt_state
	cbz	w0, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_get_next_ring
	cbz	x0, LBB0_6
; %bb.3:
	mov	x21, x0
	ldr	x8, [x20, #32]
	cmp	x8, x0
	b.eq	LBB0_6
; %bb.4:
	add	x22, x21, #8
	mov	x0, x22
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_get_wptr
	ldr	x8, [x20, #24]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	str	w0, [x8]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
Lloh5:
	adrp	x8, _REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO@GOTPAGEOFF]
Lloh7:
	adrp	x9, _REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI@GOTPAGE
Lloh8:
	ldr	x9, [x9, _REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	ldr	w2, [x9]
	ldr	x8, [x20, #16]
	ldr	x9, [x21]
	ldr	w3, [x8, x9, lsl #2]
	mov	x0, x19
	bl	_gpu_write64
	str	x21, [x20, #8]
Lloh11:
	adrp	x8, _jiffies@GOTPAGE
Lloh12:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh13:
	ldr	x21, [x8]
	mov	w0, #10000
	bl	_msecs_to_jiffies
	add	x1, x0, x21
	mov	x0, x20
	bl	_mod_timer
Lloh14:
	adrp	x8, _PREEMPT_TRIGGERED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PREEMPT_TRIGGERED@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_set_preempt_state
	bl	_wmb
Lloh17:
	adrp	x8, _REG_A5XX_CP_CONTEXT_SWITCH_CNTL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _REG_A5XX_CP_CONTEXT_SWITCH_CNTL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_gpu_write
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh20:
	adrp	x8, _PREEMPT_ABORT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PREEMPT_ABORT@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_set_preempt_state
	ldr	x1, [x20, #32]
	mov	x0, x19
	bl	_update_wptr
	ldr	w1, [x22]
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_set_preempt_state
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_PREEMPT_NONE,4,2               ; @PREEMPT_NONE
	.comm	_PREEMPT_START,4,2              ; @PREEMPT_START
	.comm	_PREEMPT_ABORT,4,2              ; @PREEMPT_ABORT
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO,4,2 ; @REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_LO
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI,4,2 ; @REG_A5XX_CP_CONTEXT_SWITCH_RESTORE_ADDR_HI
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_PREEMPT_TRIGGERED,4,2          ; @PREEMPT_TRIGGERED
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_CNTL,4,2 ; @REG_A5XX_CP_CONTEXT_SWITCH_CNTL
.subsections_via_symbols
