	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_job_timedout
_panfrost_job_timedout:                 ## @panfrost_job_timedout
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_to_panfrost_job
	movq	%rax, %rbx
	movq	8(%rax), %r13
	movq	%rax, %rdi
	callq	_panfrost_job_get_slot
	movl	%eax, %r14d
	movl	(%rbx), %edi
	callq	_dma_fence_is_signaled
	testq	%rax, %rax
	je	LBB0_1
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	24(%r13), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_JS_CONFIG
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_job_read
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_JS_STATUS
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_job_read
	movl	%eax, %r12d
	movl	%r14d, %edi
	callq	_JS_HEAD_LO
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_job_read
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_JS_TAIL_LO
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_job_read
                                        ## kill: def $eax killed $eax def $rax
	leaq	L_.str(%rip), %rsi
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r12d, %r8d
	movl	%ebx, %r9d
	pushq	%r15
	pushq	%rax
	callq	_dev_err
	addq	$16, %rsp
	movq	%r13, %rdi
	callq	_mutex_trylock
	testl	%eax, %eax
	je	LBB0_19
## %bb.2:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	_NUM_JOB_SLOTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.3:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r15
	movq	_NUM_JOB_SLOTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$4, %r12
	cmpq	%rax, %r15
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax), %rbx
	addq	%r12, %rbx
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_drm_sched_stop
	cmpq	%r15, %r14
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_cancel_delayed_work_sync
	jmp	LBB0_6
LBB0_7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_sched_increase_karma
	movq	8(%r13), %rdi
	addq	$8, %rdi
	callq	_spin_lock_irqsave
	movq	_NUM_JOB_SLOTS@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jle	LBB0_12
## %bb.8:
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rcx
	cmpq	$0, (%rcx,%rbx,8)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	24(%r13), %edi
	callq	_pm_runtime_put_noidle
	movq	16(%r13), %rax
	movq	$0, (%rax,%rbx,8)
	movl	(%r15), %eax
	jmp	LBB0_11
LBB0_12:
	movq	8(%r13), %rdi
	addq	$8, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_panfrost_devfreq_record_transition
	movq	%r13, %rdi
	callq	_panfrost_device_reset
	cmpl	$0, (%r15)
	jle	LBB0_18
## %bb.13:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax), %rdi
	addq	%r14, %rdi
	callq	_drm_sched_resubmit_jobs
	incq	%rbx
	movslq	(%r15), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_14
## %bb.15:
	testl	%eax, %eax
	jle	LBB0_18
## %bb.16:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax), %rdi
	addq	%r14, %rdi
	movl	$1, %esi
	callq	_drm_sched_start
	incq	%rbx
	movslq	(%r15), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_17
LBB0_18:
	movq	%r13, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpu sched timeout, js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p"

	.comm	_NUM_JOB_SLOTS,4,2              ## @NUM_JOB_SLOTS
	.no_dead_strip	_panfrost_job_timedout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_job_timedout
_panfrost_job_timedout:                 ; @panfrost_job_timedout
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x0
	bl	_to_panfrost_job
	mov	x22, x0
	ldr	x19, [x0, #8]
	bl	_panfrost_job_get_slot
	mov	x20, x0
	ldr	w0, [x22]
	bl	_dma_fence_is_signaled
	cbz	x0, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	w22, [x19, #24]
	mov	x0, x20
	bl	_JS_CONFIG
	mov	x1, x0
	mov	x0, x19
	bl	_job_read
	mov	x23, x0
	mov	x0, x20
	bl	_JS_STATUS
	mov	x1, x0
	mov	x0, x19
	bl	_job_read
	mov	x24, x0
	mov	x0, x20
	bl	_JS_HEAD_LO
	mov	x1, x0
	mov	x0, x19
	bl	_job_read
	mov	x25, x0
	mov	x0, x20
	bl	_JS_TAIL_LO
	mov	x1, x0
	mov	x0, x19
	bl	_job_read
	mov	x6, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	mov	x3, x23
	mov	x4, x24
	mov	x5, x25
	mov	x7, x21
	bl	_dev_err
	mov	x0, x19
	bl	_mutex_trylock
	cbz	w0, LBB0_1
; %bb.3:
Lloh2:
	adrp	x23, _NUM_JOB_SLOTS@GOTPAGE
Lloh3:
	ldr	x23, [x23, _NUM_JOB_SLOTS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x24, #0
	mov	x25, #0
	mov	w26, w20
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x23]
	add	x24, x24, #4
	cmp	x25, x8
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	add	x22, x8, x24
	mov	x0, x22
	mov	x1, x21
	bl	_drm_sched_stop
	cmp	x26, x25
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	bl	_cancel_delayed_work_sync
	b	LBB0_5
LBB0_8:
	mov	x0, x21
	bl	_drm_sched_increase_karma
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_spin_lock_irqsave
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.9:
	mov	x21, #0
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, sxtw
	b.ge	LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #16]
	ldr	x9, [x9, x21, lsl #3]
	cbz	x9, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w0, [x19, #24]
	bl	_pm_runtime_put_noidle
	ldr	x8, [x19, #16]
	str	xzr, [x8, x21, lsl #3]
	ldr	w8, [x23]
	b	LBB0_10
LBB0_13:
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	mov	x1, x20
	bl	_panfrost_devfreq_record_transition
	mov	x0, x19
	bl	_panfrost_device_reset
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.14:
	mov	x20, #0
	mov	x21, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	add	x0, x8, x20
	bl	_drm_sched_resubmit_jobs
	add	x21, x21, #1
	ldrsw	x8, [x23]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_15
; %bb.16:
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.17:
	mov	x20, #0
	mov	x21, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	add	x0, x8, x20
	mov	w1, #1
	bl	_drm_sched_start
	add	x21, x21, #1
	ldrsw	x8, [x23]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_18
LBB0_19:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpu sched timeout, js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p"

	.comm	_NUM_JOB_SLOTS,4,2              ; @NUM_JOB_SLOTS
	.no_dead_strip	_panfrost_job_timedout
.subsections_via_symbols
