	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_init_channel_buffer
_ipu_init_channel_buffer:               ## @ipu_init_channel_buffer
	.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	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r13d
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	4(%rdi), %r12d
	movl	8(%rdi), %edi
	callq	_to_idmac
	movq	%rax, %rdi
	callq	_to_ipu
	movq	%rax, %rbx
	movl	$0, -48(%rbp)
	movl	%r15d, %edi
	callq	_bytes_per_pixel
	imull	%r13d, %eax
	testb	$3, %al
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_2:
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	testb	$7, %r13b
	je	LBB0_6
## %bb.3:
	movq	_IDMAC_IC_13@GOTPCREL(%rip), %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	cmpl	(%rsi), %edx
	ja	LBB0_6
## %bb.4:
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_6:
	movl	24(%rbp), %r14d
	movl	16(%rbp), %r12d
	leaq	-48(%rbp), %r13
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%r8d, %edx
	movl	%eax, %r8d
	callq	_ipu_ch_param_set_size
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	_ipu_ch_param_set_buffer
	movq	%r13, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_ipu_ch_param_set_rotation
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	%r12d, %edi
	callq	_dma_param_addr
	movl	%eax, %edi
	movq	%r13, %rsi
	movl	$10, %edx
	callq	_ipu_write_param_mem
	movq	_IPU_CHA_DB_MODE_SEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_idmac_read_ipureg
	movl	$1, %esi
	movl	%r12d, %ecx
	shlq	%cl, %rsi
	movl	%eax, %ecx
	orl	%esi, %ecx
	notl	%esi
	andl	%eax, %esi
	cmpl	$0, 24(%rbp)
	cmovnel	%ecx, %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_idmac_write_ipureg
	movq	_IPU_CHANNEL_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Stride length must be 32-bit aligned, stride = %d, bytes = %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IDMAC_IC_13,4,2                ## @IDMAC_IC_13
L_.str.1:                               ## @.str.1
	.asciz	"Stride must be 8 pixel multiple\n"

	.comm	_IPU_CHA_DB_MODE_SEL,4,2        ## @IPU_CHA_DB_MODE_SEL
	.comm	_IPU_CHANNEL_READY,4,2          ## @IPU_CHANNEL_READY
	.no_dead_strip	_ipu_init_channel_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_init_channel_buffer
_ipu_init_channel_buffer:               ; @ipu_init_channel_buffer
	.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	x20, x7
	mov	x24, x6
	mov	x23, x5
	mov	x28, x4
	mov	x25, x3
	mov	x26, x2
	mov	x27, x1
	mov	x19, x0
	ldp	w22, w0, [x0, #4]
	bl	_to_idmac
	bl	_to_ipu
	mov	x21, x0
	str	wzr, [sp, #24]
	mov	x0, x27
	bl	_bytes_per_pixel
	mul	w4, w0, w28
	tst	w4, #0x3
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x21, #4]
	stp	x28, x4, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_5
LBB0_2:
	tst	w28, #0x7
	b.eq	LBB0_6
; %bb.3:
Lloh2:
	adrp	x8, _IDMAC_IC_13@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IDMAC_IC_13@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w22, w8
	b.hi	LBB0_6
; %bb.4:
	ldr	w0, [x21, #4]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	add	x0, sp, #24
	mov	x1, x27
	mov	x2, x26
	mov	x3, x25
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_ipu_ch_param_set_size
	add	x0, sp, #24
	mov	x1, x24
	mov	x2, x20
	bl	_ipu_ch_param_set_buffer
	add	x0, sp, #24
	mov	x1, x23
	bl	_ipu_ch_param_set_rotation
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x22
	bl	_dma_param_addr
	add	x1, sp, #24
	mov	w2, #10
	bl	_ipu_write_param_mem
Lloh10:
	adrp	x23, _IPU_CHA_DB_MODE_SEL@GOTPAGE
Lloh11:
	ldr	x23, [x23, _IPU_CHA_DB_MODE_SEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_idmac_read_ipureg
	mov	w8, #1
	lsl	x8, x8, x22
	orr	w9, w0, w8
	bic	w8, w0, w8
	cmp	w20, #0
	csel	w1, w8, w9, eq
	ldr	w2, [x23]
	mov	x0, x21
	bl	_idmac_write_ipureg
Lloh12:
	adrp	x8, _IPU_CHANNEL_READY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IPU_CHANNEL_READY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_7:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Stride length must be 32-bit aligned, stride = %d, bytes = %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IDMAC_IC_13,4,2                ; @IDMAC_IC_13
l_.str.1:                               ; @.str.1
	.asciz	"Stride must be 8 pixel multiple\n"

	.comm	_IPU_CHA_DB_MODE_SEL,4,2        ; @IPU_CHA_DB_MODE_SEL
	.comm	_IPU_CHANNEL_READY,4,2          ; @IPU_CHANNEL_READY
	.no_dead_strip	_ipu_init_channel_buffer
.subsections_via_symbols
