	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_enable_channel
_ipu_enable_channel:                    ## @ipu_enable_channel
	.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	%rsi, %r12
	callq	_to_ipu
	movq	%rax, %r15
	movl	16(%r12), %r14d
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	movl	$1, %ebx
	movl	%r14d, %ecx
	shlq	%cl, %rbx
	movq	_IPU_CHA_CUR_BUF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_idmac_write_ipureg
	movq	$0, 8(%r12)
	movq	_IPU_CHANNEL_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	leal	-128(%r14), %eax
	cmpl	$2, %eax
	ja	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_ipu_channel_set_priority
LBB0_2:
	movq	_IDMAC_CHA_EN@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_idmac_read_icreg
	orq	%rax, %rbx
	movl	(%r12), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_idmac_write_icreg
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ipu_ic_enable_task
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IPU_CHA_CUR_BUF,4,2            ## @IPU_CHA_CUR_BUF
	.comm	_IPU_CHANNEL_ENABLED,4,2        ## @IPU_CHANNEL_ENABLED
	.comm	_IDMAC_CHA_EN,4,2               ## @IDMAC_CHA_EN
	.no_dead_strip	_ipu_enable_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_enable_channel
_ipu_enable_channel:                    ; @ipu_enable_channel
	.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	x22, x1
	bl	_to_ipu
	mov	x19, x0
	ldr	w20, [x22, #16]
	bl	_spin_lock_irqsave
	mov	w8, #1
	lsl	x21, x8, x20
Lloh0:
	adrp	x8, _IPU_CHA_CUR_BUF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IPU_CHA_CUR_BUF@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_idmac_write_ipureg
	str	xzr, [x22, #8]
Lloh3:
	adrp	x8, _IPU_CHANNEL_ENABLED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IPU_CHANNEL_ENABLED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x22]
	sub	w8, w20, #128
	cmp	w8, #2
	b.hi	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_ipu_channel_set_priority
LBB0_2:
Lloh6:
	adrp	x22, _IDMAC_CHA_EN@GOTPAGE
Lloh7:
	ldr	x22, [x22, _IDMAC_CHA_EN@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_idmac_read_icreg
	orr	x1, x0, x21
	ldr	w2, [x22]
	mov	x0, x19
	bl	_idmac_write_icreg
	mov	x0, x19
	mov	x1, x20
	bl	_ipu_ic_enable_task
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_IPU_CHA_CUR_BUF,4,2            ; @IPU_CHA_CUR_BUF
	.comm	_IPU_CHANNEL_ENABLED,4,2        ; @IPU_CHANNEL_ENABLED
	.comm	_IDMAC_CHA_EN,4,2               ; @IDMAC_CHA_EN
	.no_dead_strip	_ipu_enable_channel
.subsections_via_symbols
