	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_job_init              ## -- Begin function panfrost_job_init
	.p2align	4, 0x90
_panfrost_job_init:                     ## @panfrost_job_init
	.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
	movl	(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_devm_kzalloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	leaq	8(%rax), %rdi
	callq	_spin_lock_init
	movl	(%r14), %edi
	callq	_to_platform_device
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_platform_get_irq_byname
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:
	movl	(%r14), %edi
	movq	_panfrost_job_irq_handler@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str(%rip), %r8
	movl	%eax, %esi
	movq	%r14, %r9
	callq	_devm_request_irq
	testl	%eax, %eax
	je	LBB0_6
## %bb.15:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_NUM_JOB_SLOTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_13
## %bb.7:
	movq	$-1, %r12
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_dma_fence_context_alloc
	movq	(%r15), %rbx
	movl	%eax, 4(%rbx,%r13)
	addq	%r13, %rbx
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movq	_panfrost_sched_ops@GOTPCREL(%rip), %rsi
	movl	$1, %edx
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	leaq	L_.str.2(%rip), %r9
	callq	_drm_sched_init
	testl	%eax, %eax
	jne	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	incq	%r14
	movq	_NUM_JOB_SLOTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$8, %r13
	decq	%r12
	cmpq	%rax, %r14
	jl	LBB0_8
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_panfrost_job_enable_interrupts
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_9:
	movl	%eax, %ebx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	cmpl	$-1, %r12d
	je	LBB0_14
## %bb.10:
	addq	$-8, %r13
	negq	%r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%r13, %rdi
	callq	_drm_sched_fini
	decq	%r12
	addq	$-8, %r13
	cmpq	$1, %r12
	jg	LBB0_11
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"job"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_panfrost_job_irq_handler,4,2   ## @panfrost_job_irq_handler
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
L_.str.1:                               ## @.str.1
	.asciz	"failed to request job irq"

	.comm	_NUM_JOB_SLOTS,4,2              ## @NUM_JOB_SLOTS
	.comm	_panfrost_sched_ops,4,2         ## @panfrost_sched_ops
L_.str.2:                               ## @.str.2
	.asciz	"pan_js"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to create scheduler: %d."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_job_init              ; -- Begin function panfrost_job_init
	.p2align	2
_panfrost_job_init:                     ; @panfrost_job_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_devm_kzalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	add	x0, x0, #8
	bl	_spin_lock_init
	ldr	w0, [x20]
	bl	_to_platform_device
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_platform_get_irq_byname
	cmp	w0, #0
	b.le	LBB0_5
; %bb.2:
	mov	x1, x0
	ldr	w0, [x20]
Lloh5:
	adrp	x8, _panfrost_job_irq_handler@GOTPAGE
Lloh6:
	ldr	x8, [x8, _panfrost_job_irq_handler@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
Lloh11:
	adrp	x4, l_.str@PAGE
Lloh12:
	add	x4, x4, l_.str@PAGEOFF
	mov	x5, x20
	bl	_devm_request_irq
	cbz	w0, LBB0_8
; %bb.3:
	mov	x21, x0
	ldr	w0, [x20]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
Lloh19:
	adrp	x26, _NUM_JOB_SLOTS@GOTPAGE
Lloh20:
	ldr	x26, [x26, _NUM_JOB_SLOTS@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	x25, #0
	mov	x24, #0
Lloh21:
	adrp	x22, _panfrost_sched_ops@GOTPAGE
Lloh22:
	ldr	x22, [x22, _panfrost_sched_ops@GOTPAGEOFF]
Lloh23:
	adrp	x23, l_.str.2@PAGE
Lloh24:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_dma_fence_context_alloc
	ldr	x8, [x19]
	add	x21, x8, x25
	str	w0, [x21, #4]
	mov	w0, #500
	bl	_msecs_to_jiffies
	mov	x4, x0
	mov	x0, x21
	mov	x1, x22
	mov	w2, #1
	mov	w3, #0
	mov	x5, x23
	bl	_drm_sched_init
	cbnz	w0, LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x26]
	add	x25, x25, #8
	cmp	x24, x8
	b.lt	LBB0_10
LBB0_12:
	mov	x0, x20
	bl	_panfrost_job_enable_interrupts
	mov	w21, #0
	b	LBB0_7
LBB0_13:
	mov	x21, x0
	ldr	w0, [x20]
	str	x21, [sp]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	cbz	w24, LBB0_7
; %bb.14:
	sub	x20, x25, #8
	add	x22, x24, #1
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	add	x0, x8, x20
	bl	_drm_sched_fini
	sub	x22, x22, #1
	sub	x20, x20, #8
	cmp	x22, #1
	b.gt	LBB0_15
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"job"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_panfrost_job_irq_handler,4,2   ; @panfrost_job_irq_handler
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
l_.str.1:                               ; @.str.1
	.asciz	"failed to request job irq"

	.comm	_NUM_JOB_SLOTS,4,2              ; @NUM_JOB_SLOTS
	.comm	_panfrost_sched_ops,4,2         ; @panfrost_sched_ops
l_.str.2:                               ; @.str.2
	.asciz	"pan_js"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to create scheduler: %d."

.subsections_via_symbols
