	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_encoder_helper_register_irq ## -- Begin function dpu_encoder_helper_register_irq
	.p2align	4, 0x90
_dpu_encoder_helper_register_irq:       ## @dpu_encoder_helper_register_irq
	.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
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.1:
	movl	%esi, %r12d
	movq	_INTR_IDX_MAX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jbe	LBB0_5
## %bb.2:
	movq	%rdi, %r15
	movq	8(%rdi), %r13
	movl	%r12d, %eax
	leaq	(%rax,%rax,4), %r14
	cmpl	$0, (%r13,%r14,4)
	js	LBB0_8
## %bb.3:
	movl	12(%r13,%r14,4), %edx
	movl	16(%r13,%r14,4), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_DPU_DEBUG_PHYS
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_DPU_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_6:
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	(,%r14,4), %rbx
	addq	%r13, %rbx
	movl	4(%r15), %edi
	movl	4(%r13,%r14,4), %edx
	movl	16(%r13,%r14,4), %esi
	callq	_dpu_core_irq_idx_lookup
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, (%rbx)
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	movl	4(%r15), %edi
	leaq	8(,%r14,4), %rdx
	addq	%r13, %rdx
	movl	%eax, %esi
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	callq	_dpu_core_irq_register_callback
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %ebx
	movl	12(%r13,%r14,4), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_DPU_ERROR_PHYS
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	jmp	LBB0_7
LBB0_11:
	leaq	16(,%r14,4), %rax
	addq	%r13, %rax
	movl	12(%r13,%r14,4), %edx
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_DPU_ERROR_PHYS
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_12:
	leaq	4(,%r14,4), %r14
	addq	%r13, %r14
	movl	4(%r15), %edi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_dpu_core_irq_enable
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_DRMID
	movl	(%r14), %ecx
	movl	(%r13), %r8d
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.13:
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_DRM_ERROR
	movl	4(%r15), %edi
	movl	(%r13), %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_dpu_core_irq_unregister_callback
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, (%r13)
	jmp	LBB0_7
LBB0_14:
	movl	%eax, %edi
	movl	%r12d, %esi
	movl	%ecx, %edx
	movl	%r8d, %ecx
	callq	_trace_dpu_enc_irq_register_success
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_INTR_IDX_MAX,4,2               ## @INTR_IDX_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid params\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"skipping already registered irq %s type %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to lookup IRQ index for %s type:%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to register IRQ callback for %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"enable failed id=%u, intr=%d, hw=%d, irq=%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_encoder_helper_register_irq ; -- Begin function dpu_encoder_helper_register_irq
	.p2align	2
_dpu_encoder_helper_register_irq:       ; @dpu_encoder_helper_register_irq
	.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
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x1
Lloh0:
	adrp	x8, _INTR_IDX_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTR_IDX_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ls	LBB0_4
; %bb.2:
	mov	x19, x0
	ldr	x24, [x0, #8]
	mov	w25, w21
	mov	w8, #20
	umaddl	x20, w21, w8, x24
	ldr	w8, [x20]
	tbnz	w8, #31, LBB0_7
; %bb.3:
	mov	w8, #20
	madd	x8, x25, x8, x24
	ldp	w2, w3, [x8, #12]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_DPU_DEBUG_PHYS
	mov	w22, #0
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_ERROR
LBB0_5:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_6:
	mov	x0, x22
	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_7:
	ldr	w0, [x19, #4]
	mov	w8, #20
	madd	x22, x25, x8, x24
	ldr	w1, [x22, #16]!
	mov	x26, x22
	ldr	w2, [x26, #-12]!
	bl	_dpu_core_irq_idx_lookup
	str	w0, [x20]
	tbnz	w0, #31, LBB0_10
; %bb.8:
	mov	x1, x0
	ldr	w0, [x19, #4]
	mov	w8, #20
	madd	x8, x25, x8, x24
	add	x23, x8, #8
	mov	x2, x23
	bl	_dpu_core_irq_register_callback
	cbz	w0, LBB0_11
; %bb.9:
	mov	x22, x0
	mov	w8, #20
	madd	x8, x25, x8, x24
	ldr	w2, [x8, #12]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_DPU_ERROR_PHYS
	b	LBB0_13
LBB0_10:
	mov	w8, #20
	madd	x8, x25, x8, x24
	ldr	w2, [x8, #12]
	ldr	w8, [x22]
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_DPU_ERROR_PHYS
	b	LBB0_5
LBB0_11:
	ldr	w0, [x19, #4]
	mov	x1, x20
	mov	w2, #1
	bl	_dpu_core_irq_enable
	mov	x22, x0
	ldr	w0, [x19]
	bl	_DRMID
	mov	x1, x0
	ldr	w3, [x26]
	ldr	w4, [x20]
	cbz	w22, LBB0_14
; %bb.12:
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x2, x21
	bl	_DRM_ERROR
	ldr	w0, [x19, #4]
	ldr	w1, [x20]
	mov	x2, x23
	bl	_dpu_core_irq_unregister_callback
LBB0_13:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20]
	b	LBB0_6
LBB0_14:
	mov	x0, x1
	mov	x1, x21
	mov	x2, x3
	mov	x3, x4
	bl	_trace_dpu_enc_irq_register_success
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_INTR_IDX_MAX,4,2               ; @INTR_IDX_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid params\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"skipping already registered irq %s type %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to lookup IRQ index for %s type:%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to register IRQ callback for %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"enable failed id=%u, intr=%d, hw=%d, irq=%d"

.subsections_via_symbols
