	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a5xx_preempt_start
_a5xx_preempt_start:                    ## @a5xx_preempt_start
	.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, %r14
	callq	_to_adreno_gpu
	movq	%rax, %rdi
	callq	_to_a5xx_gpu
	xorl	%ecx, %ecx
	cmpl	$1, (%r14)
	je	LBB0_2
## %bb.1:
	movq	%rax, %r15
	movq	16(%r14), %rax
	movq	(%rax), %rbx
	movq	_CP_SET_PROTECTED_MODE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_OUT_PKT7
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	_REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$2, %edx
	callq	_OUT_PKT4
	movq	(%r15), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_lower_32_bits
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_OUT_RING
	movq	(%r15), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_upper_32_bits
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_OUT_RING
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_OUT_PKT7
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	_CP_PREEMPT_ENABLE_GLOBAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_OUT_PKT7
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	_CP_PREEMPT_ENABLE_LOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_OUT_PKT7
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	_CP_YIELD_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_OUT_PKT7
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	_CP_CONTEXT_SWITCH_YIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_OUT_PKT7
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	8(%r14), %rax
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	*(%rax)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_a5xx_idle
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	subl	(%rdx), %ecx
	testq	%rax, %rax
	cmovnel	%r12d, %ecx
LBB0_2:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CP_SET_PROTECTED_MODE,4,2      ## @CP_SET_PROTECTED_MODE
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO,4,2 ## @REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO
	.comm	_CP_PREEMPT_ENABLE_GLOBAL,4,2   ## @CP_PREEMPT_ENABLE_GLOBAL
	.comm	_CP_PREEMPT_ENABLE_LOCAL,4,2    ## @CP_PREEMPT_ENABLE_LOCAL
	.comm	_CP_YIELD_ENABLE,4,2            ## @CP_YIELD_ENABLE
	.comm	_CP_CONTEXT_SWITCH_YIELD,4,2    ## @CP_CONTEXT_SWITCH_YIELD
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_a5xx_preempt_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a5xx_preempt_start
_a5xx_preempt_start:                    ; @a5xx_preempt_start
	.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.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	mov	x21, x0
	ldr	x8, [x19, #16]
	ldr	x20, [x8]
Lloh0:
	adrp	x22, _CP_SET_PROTECTED_MODE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CP_SET_PROTECTED_MODE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #1
	bl	_OUT_PKT7
	mov	x0, x20
	mov	w1, #0
	bl	_OUT_RING
Lloh2:
	adrp	x8, _REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #2
	bl	_OUT_PKT4
	ldr	x8, [x21]
	ldr	x9, [x20]
	ldr	w0, [x8, x9, lsl #2]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_OUT_RING
	ldr	x8, [x21]
	ldr	x9, [x20]
	ldr	w0, [x8, x9, lsl #2]
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_OUT_RING
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #1
	bl	_OUT_PKT7
	mov	x0, x20
	mov	w1, #1
	bl	_OUT_RING
Lloh5:
	adrp	x8, _CP_PREEMPT_ENABLE_GLOBAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CP_PREEMPT_ENABLE_GLOBAL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_OUT_PKT7
	mov	x0, x20
	mov	w1, #0
	bl	_OUT_RING
Lloh8:
	adrp	x8, _CP_PREEMPT_ENABLE_LOCAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CP_PREEMPT_ENABLE_LOCAL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_OUT_PKT7
	mov	x0, x20
	mov	w1, #1
	bl	_OUT_RING
Lloh11:
	adrp	x8, _CP_YIELD_ENABLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CP_YIELD_ENABLE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_OUT_PKT7
	mov	x0, x20
	mov	w1, #1
	bl	_OUT_RING
Lloh14:
	adrp	x8, _CP_CONTEXT_SWITCH_YIELD@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CP_CONTEXT_SWITCH_YIELD@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #4
	bl	_OUT_PKT7
	mov	x0, x20
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x20
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x20
	mov	w1, #1
	bl	_OUT_RING
	mov	x0, x20
	mov	w1, #1
	bl	_OUT_RING
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	mov	x0, x19
	mov	x1, x20
	bl	_a5xx_idle
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w0, wzr, w8, ne
LBB0_3:
	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
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_CP_SET_PROTECTED_MODE,4,2      ; @CP_SET_PROTECTED_MODE
	.comm	_REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO,4,2 ; @REG_A5XX_CP_CONTEXT_SWITCH_SAVE_ADDR_LO
	.comm	_CP_PREEMPT_ENABLE_GLOBAL,4,2   ; @CP_PREEMPT_ENABLE_GLOBAL
	.comm	_CP_PREEMPT_ENABLE_LOCAL,4,2    ; @CP_PREEMPT_ENABLE_LOCAL
	.comm	_CP_YIELD_ENABLE,4,2            ; @CP_YIELD_ENABLE
	.comm	_CP_CONTEXT_SWITCH_YIELD,4,2    ; @CP_CONTEXT_SWITCH_YIELD
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_a5xx_preempt_start
.subsections_via_symbols
