	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_gpu_soft_reset        ## -- Begin function panfrost_gpu_soft_reset
	.p2align	4, 0x90
_panfrost_gpu_soft_reset:               ## @panfrost_gpu_soft_reset
	.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
	movq	_GPU_INT_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	xorl	%edx, %edx
	callq	_gpu_write
	movq	_GPU_INT_CLEAR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_GPU_IRQ_RESET_COMPLETED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_gpu_write
	movq	_GPU_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GPU_CMD_SOFT_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_gpu_write
	movq	_GPU_INT_RAWSTAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	xorl	%edx, %edx
	movl	$100, %ecx
	movl	$10000, %r8d                    ## imm = 0x2710
	callq	_readl_relaxed_poll_timeout
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_3
LBB0_2:
	movl	(%r12), %esi
	movq	_GPU_IRQ_MASK_ALL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_gpu_write
	movl	(%r15), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_gpu_write
LBB0_3:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GPU_INT_MASK,4,2               ## @GPU_INT_MASK
	.comm	_GPU_INT_CLEAR,4,2              ## @GPU_INT_CLEAR
	.comm	_GPU_IRQ_RESET_COMPLETED,4,2    ## @GPU_IRQ_RESET_COMPLETED
	.comm	_GPU_CMD,4,2                    ## @GPU_CMD
	.comm	_GPU_CMD_SOFT_RESET,4,2         ## @GPU_CMD_SOFT_RESET
	.comm	_GPU_INT_RAWSTAT,8,3            ## @GPU_INT_RAWSTAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpu soft reset timed out\n"

	.comm	_GPU_IRQ_MASK_ALL,4,2           ## @GPU_IRQ_MASK_ALL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_gpu_soft_reset        ; -- Begin function panfrost_gpu_soft_reset
	.p2align	2
_panfrost_gpu_soft_reset:               ; @panfrost_gpu_soft_reset
	.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
Lloh0:
	adrp	x21, _GPU_INT_MASK@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GPU_INT_MASK@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w2, #0
	bl	_gpu_write
Lloh2:
	adrp	x22, _GPU_INT_CLEAR@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GPU_INT_CLEAR@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh4:
	adrp	x8, _GPU_IRQ_RESET_COMPLETED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GPU_IRQ_RESET_COMPLETED@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_gpu_write
Lloh7:
	adrp	x8, _GPU_CMD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GPU_CMD@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _GPU_CMD_SOFT_RESET@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GPU_CMD_SOFT_RESET@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_gpu_write
	ldr	x8, [x19, #8]
Lloh13:
	adrp	x9, _GPU_INT_RAWSTAT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _GPU_INT_RAWSTAT@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	add	x0, x9, x8
	mov	w2, #0
	mov	w3, #100
	mov	w4, #10000
	bl	_readl_relaxed_poll_timeout
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_3
LBB0_2:
	ldr	w1, [x22]
Lloh18:
	adrp	x22, _GPU_IRQ_MASK_ALL@GOTPAGE
Lloh19:
	ldr	x22, [x22, _GPU_IRQ_MASK_ALL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_gpu_write
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_gpu_write
LBB0_3:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GPU_INT_MASK,4,2               ; @GPU_INT_MASK
	.comm	_GPU_INT_CLEAR,4,2              ; @GPU_INT_CLEAR
	.comm	_GPU_IRQ_RESET_COMPLETED,4,2    ; @GPU_IRQ_RESET_COMPLETED
	.comm	_GPU_CMD,4,2                    ; @GPU_CMD
	.comm	_GPU_CMD_SOFT_RESET,4,2         ; @GPU_CMD_SOFT_RESET
	.comm	_GPU_INT_RAWSTAT,8,3            ; @GPU_INT_RAWSTAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpu soft reset timed out\n"

	.comm	_GPU_IRQ_MASK_ALL,4,2           ; @GPU_IRQ_MASK_ALL
.subsections_via_symbols
