	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_disable_channel
_ipu_disable_channel:                   ## @ipu_disable_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r12
	movl	4(%rsi), %r14d
	callq	_to_ipu
	movl	$1, %r15d
	movl	%r14d, %ecx
	shlq	%cl, %r15
	movq	%rax, %r13
	movq	_IDMAC_SDC_1@GOTPCREL(%rip), %rax
	movq	_IDMAC_SDC_0@GOTPCREL(%rip), %rcx
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.1:
	cmpl	(%rax), %r14d
	je	LBB0_9
## %bb.2:
	cmpl	(%rcx), %r14d
	je	LBB0_9
## %bb.3:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$40, %ebx
	movq	_IDMAC_CHA_BUSY@GOTPCREL(%rip), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$10, %edi
	callq	_msleep
	decl	%ebx
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_idmac_read_icreg
	testq	%r15, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_ipu_channel_status
	movq	_TASK_STAT_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
	jmp	LBB0_8
LBB0_7:
	movl	4(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_IPU_CHA_BUF0_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_idmac_read_ipureg
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_IPU_CHA_BUF1_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_idmac_read_ipureg
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_idmac_read_icreg
	movq	%rax, %r12
	movq	_IPU_TASKS_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_idmac_read_ipureg
	movq	%rax, (%rsp)
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	%r12, %r9
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_8:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	4(%r13), %edi
	movl	$40, %edx
	subl	%ebx, %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movq	_IDMAC_SDC_1@GOTPCREL(%rip), %rax
	movq	_IDMAC_SDC_0@GOTPCREL(%rip), %rcx
LBB0_9:
	testl	%ebx, %ebx
	je	LBB0_18
## %bb.10:
	cmpl	(%rcx), %r14d
	je	LBB0_12
## %bb.11:
	cmpl	(%rax), %r14d
	jne	LBB0_18
LBB0_12:
	movl	(%r12), %edi
	callq	_ipu_irq_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.13:
	movl	$5, %edi
	callq	_msleep
	movl	(%r12), %edi
	callq	_ipu_irq_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.14:
	movl	$5, %edi
	callq	_msleep
	movl	(%r12), %edi
	callq	_ipu_irq_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:
	movl	$5, %edi
	callq	_msleep
	movl	(%r12), %edi
	callq	_ipu_irq_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.16:
	movl	$5, %edi
	callq	_msleep
	movl	(%r12), %edi
	callq	_ipu_irq_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.17:
	movl	$5, %edi
	callq	_msleep
LBB0_18:
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_ipu_ic_disable_task
	movq	_IDMAC_CHA_EN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_idmac_read_icreg
	notq	%r15
	andq	%r15, %rax
	movl	(%rbx), %edx
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_idmac_write_icreg
	movq	_IPU_CHA_BUF0_RDY@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_idmac_read_ipureg
	movq	%rax, %rbx
	movl	(%r14), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_idmac_write_ipureg
	andq	%r15, %rbx
	movl	(%r14), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_idmac_write_ipureg
	movq	_IPU_CHA_BUF1_RDY@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_idmac_read_ipureg
	movq	%rax, %rbx
	movl	(%r14), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_idmac_write_ipureg
	andq	%r15, %rbx
	movl	(%r14), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_idmac_write_ipureg
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDMAC_SDC_1,4,2                ## @IDMAC_SDC_1
	.comm	_IDMAC_SDC_0,4,2                ## @IDMAC_SDC_0
	.comm	_IDMAC_CHA_BUSY,4,2             ## @IDMAC_CHA_BUSY
	.comm	_TASK_STAT_ACTIVE,8,3           ## @TASK_STAT_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: timeout waiting for channel %u to stop: buf0_rdy = 0x%08X, buf1_rdy = 0x%08X, busy = 0x%08X, tstat = 0x%08X\n"

	.comm	_IPU_CHA_BUF0_RDY,4,2           ## @IPU_CHA_BUF0_RDY
	.comm	_IPU_CHA_BUF1_RDY,4,2           ## @IPU_CHA_BUF1_RDY
	.comm	_IPU_TASKS_STAT,4,2             ## @IPU_TASKS_STAT
L_.str.1:                               ## @.str.1
	.asciz	"timeout = %d * 10ms\n"

	.comm	_IDMAC_CHA_EN,4,2               ## @IDMAC_CHA_EN
	.no_dead_strip	_ipu_disable_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_disable_channel
_ipu_disable_channel:                   ; @ipu_disable_channel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x2
	mov	x21, x1
	ldr	w20, [x1, #4]
	bl	_to_ipu
	mov	x19, x0
	mov	w8, #1
	lsl	x27, x8, x20
Lloh0:
	adrp	x28, _IDMAC_SDC_1@GOTPAGE
Lloh1:
	ldr	x28, [x28, _IDMAC_SDC_1@GOTPAGEOFF]
Lloh2:
	adrp	x26, _IDMAC_SDC_0@GOTPAGE
Lloh3:
	ldr	x26, [x26, _IDMAC_SDC_0@GOTPAGEOFF]
Lloh4:
	adrp	x24, _IPU_CHA_BUF0_RDY@GOTPAGE
Lloh5:
	ldr	x24, [x24, _IPU_CHA_BUF0_RDY@GOTPAGEOFF]
Lloh6:
	adrp	x25, _IPU_CHA_BUF1_RDY@GOTPAGE
Lloh7:
	ldr	x25, [x25, _IPU_CHA_BUF1_RDY@GOTPAGEOFF]
	cbz	w22, LBB0_9
; %bb.1:
	ldr	w8, [x28]
	ldr	w9, [x26]
	cmp	w20, w8
	ccmp	w20, w9, #4, ne
	b.eq	LBB0_9
; %bb.2:
	mov	w23, #40
Lloh8:
	adrp	x26, _IDMAC_CHA_BUSY@GOTPAGE
Lloh9:
	ldr	x26, [x26, _IDMAC_CHA_BUSY@GOTPAGEOFF]
Lloh10:
	adrp	x24, _TASK_STAT_ACTIVE@GOTPAGE
Lloh11:
	ldr	x24, [x24, _TASK_STAT_ACTIVE@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	w23, w23, #1
	mov	w0, #10
	bl	_msleep
	cbz	w23, LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	bl	_idmac_read_icreg
	tst	x0, x27
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_ipu_channel_status
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.6:
Lloh12:
	adrp	x24, _IPU_CHA_BUF0_RDY@GOTPAGE
Lloh13:
	ldr	x24, [x24, _IPU_CHA_BUF0_RDY@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	ldr	w23, [x19, #4]
Lloh14:
	adrp	x28, _IPU_CHA_BUF0_RDY@GOTPAGE
Lloh15:
	ldr	x28, [x28, _IPU_CHA_BUF0_RDY@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x19
	bl	_idmac_read_ipureg
	mov	x24, x0
	ldr	w1, [x25]
	mov	x0, x19
	bl	_idmac_read_ipureg
	mov	x25, x0
	ldr	w1, [x26]
	mov	x0, x19
	bl	_idmac_read_icreg
	mov	x26, x0
Lloh16:
	adrp	x8, _IPU_TASKS_STAT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IPU_TASKS_STAT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_idmac_read_ipureg
	stp	x26, x0, [sp, #16]
	str	x25, [sp, #8]
Lloh19:
	adrp	x25, _IPU_CHA_BUF1_RDY@GOTPAGE
Lloh20:
	ldr	x25, [x25, _IPU_CHA_BUF1_RDY@GOTPAGEOFF]
	str	x24, [sp]
	mov	x24, x28
Lloh21:
	adrp	x28, _IDMAC_SDC_1@GOTPAGE
Lloh22:
	ldr	x28, [x28, _IDMAC_SDC_1@GOTPAGEOFF]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x20
	bl	_dev_dbg
	mov	w23, #0
LBB0_8:
Lloh25:
	adrp	x26, _IDMAC_SDC_0@GOTPAGE
Lloh26:
	ldr	x26, [x26, _IDMAC_SDC_0@GOTPAGEOFF]
	ldr	w0, [x19, #4]
	mov	w8, #40
	sub	w2, w8, w23
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_9:
	cbz	w22, LBB0_17
; %bb.10:
	ldr	w8, [x26]
	ldr	w9, [x28]
	cmp	w20, w8
	ccmp	w20, w9, #4, ne
	b.ne	LBB0_17
; %bb.11:
	ldr	w0, [x21]
	bl	_ipu_irq_status
	cbnz	w0, LBB0_17
; %bb.12:
	mov	w0, #5
	bl	_msleep
	ldr	w0, [x21]
	bl	_ipu_irq_status
	cbnz	w0, LBB0_17
; %bb.13:
	mov	w0, #5
	bl	_msleep
	ldr	w0, [x21]
	bl	_ipu_irq_status
	cbnz	w0, LBB0_17
; %bb.14:
	mov	w0, #5
	bl	_msleep
	ldr	w0, [x21]
	bl	_ipu_irq_status
	cbnz	w0, LBB0_17
; %bb.15:
	mov	w0, #5
	bl	_msleep
	ldr	w0, [x21]
	bl	_ipu_irq_status
	cbnz	w0, LBB0_17
; %bb.16:
	mov	w0, #5
	bl	_msleep
LBB0_17:
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x20
	bl	_ipu_ic_disable_task
Lloh29:
	adrp	x20, _IDMAC_CHA_EN@GOTPAGE
Lloh30:
	ldr	x20, [x20, _IDMAC_CHA_EN@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_idmac_read_icreg
	bic	x1, x0, x27
	ldr	w2, [x20]
	mov	x0, x19
	bl	_idmac_write_icreg
	ldr	w1, [x24]
	mov	x0, x19
	bl	_idmac_read_ipureg
	mov	x20, x0
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, #0
	bl	_idmac_write_ipureg
	bic	x1, x20, x27
	ldr	w2, [x24]
	mov	x0, x19
	bl	_idmac_write_ipureg
	ldr	w1, [x25]
	mov	x0, x19
	bl	_idmac_read_ipureg
	mov	x20, x0
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, #0
	bl	_idmac_write_ipureg
	bic	x1, x20, x27
	ldr	w2, [x25]
	mov	x0, x19
	bl	_idmac_write_ipureg
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_IDMAC_SDC_1,4,2                ; @IDMAC_SDC_1
	.comm	_IDMAC_SDC_0,4,2                ; @IDMAC_SDC_0
	.comm	_IDMAC_CHA_BUSY,4,2             ; @IDMAC_CHA_BUSY
	.comm	_TASK_STAT_ACTIVE,8,3           ; @TASK_STAT_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: timeout waiting for channel %u to stop: buf0_rdy = 0x%08X, buf1_rdy = 0x%08X, busy = 0x%08X, tstat = 0x%08X\n"

	.comm	_IPU_CHA_BUF0_RDY,4,2           ; @IPU_CHA_BUF0_RDY
	.comm	_IPU_CHA_BUF1_RDY,4,2           ; @IPU_CHA_BUF1_RDY
	.comm	_IPU_TASKS_STAT,4,2             ; @IPU_TASKS_STAT
l_.str.1:                               ; @.str.1
	.asciz	"timeout = %d * 10ms\n"

	.comm	_IDMAC_CHA_EN,4,2               ; @IDMAC_CHA_EN
	.no_dead_strip	_ipu_disable_channel
.subsections_via_symbols
