	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdc_set_mode
_pdc_set_mode:                          ## @pdc_set_mode
	.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
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_to_pd
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ebx
	cmpl	$7, %ebx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jg	LBB0_2
## %bb.1:
	movq	_DMA_MASK_CTL0_MODE@GOTPCREL(%rip), %rdx
	movq	_DMA_CTL0_MODE_MASK_BITS@GOTPCREL(%rip), %rcx
	movq	_DMA_CTL0_BITS_PER_CH@GOTPCREL(%rip), %rsi
	imull	(%rsi), %ebx
	movl	(%rcx), %r15d
	movl	%ebx, %ecx
	shll	%cl, %r15d
	notl	%r15d
	movq	_DMA_CTL0_DIR_SHIFT_BITS@GOTPCREL(%rip), %rcx
	addl	(%rcx), %ebx
	movl	$1, %r14d
	movl	%ebx, %ecx
	shll	%cl, %r14d
	andl	(%rdx), %r15d
	movq	_CTL0@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rax, %rdi
	callq	_dma_readl
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %ecx
	movq	_DMA_CTL0_BITS_PER_CH@GOTPCREL(%rip), %rdx
	imull	(%rdx), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	andl	%r14d, %eax
	orl	%eax, %r12d
	orl	%r15d, %r12d
	jmp	LBB0_3
LBB0_2:
	addl	$-8, %ebx
	movq	_DMA_MASK_CTL2_MODE@GOTPCREL(%rip), %rsi
	movq	_DMA_CTL0_MODE_MASK_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	_DMA_CTL0_BITS_PER_CH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%ebx, %ecx
	shll	%cl, %r15d
	notl	%r15d
	movq	_DMA_CTL0_DIR_SHIFT_BITS@GOTPCREL(%rip), %rdx
	addl	(%rdx), %ecx
	movl	$1, %r14d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r14d
	andl	(%rsi), %r15d
	movq	_CTL3@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rax, %rdi
	callq	_dma_readl
	movq	_DMA_CTL0_BITS_PER_CH@GOTPCREL(%rip), %rcx
	imull	(%rcx), %ebx
	movl	%ebx, %ecx
	shll	%cl, %r12d
	andl	%r14d, %eax
	orl	%eax, %r12d
	orl	%r15d, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_3:
	movl	(%r13), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_dma_writel
	movq	%rbx, %rdi
	callq	_chan2dev
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r12d, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_MASK_CTL0_MODE,4,2         ## @DMA_MASK_CTL0_MODE
	.comm	_DMA_CTL0_MODE_MASK_BITS,4,2    ## @DMA_CTL0_MODE_MASK_BITS
	.comm	_DMA_CTL0_BITS_PER_CH,4,2       ## @DMA_CTL0_BITS_PER_CH
	.comm	_DMA_CTL0_DIR_SHIFT_BITS,4,2    ## @DMA_CTL0_DIR_SHIFT_BITS
	.comm	_CTL0,4,2                       ## @CTL0
	.comm	_DMA_MASK_CTL2_MODE,4,2         ## @DMA_MASK_CTL2_MODE
	.comm	_CTL3,4,2                       ## @CTL3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pdc_set_mode: chan %d -> %x\n"

	.no_dead_strip	_pdc_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdc_set_mode
_pdc_set_mode:                          ; @pdc_set_mode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_to_pd
	mov	x20, x0
	ldr	w8, [x19]
	cmp	w8, #7
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, _DMA_MASK_CTL0_MODE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_MASK_CTL0_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _DMA_CTL0_MODE_MASK_BITS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DMA_CTL0_MODE_MASK_BITS@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
Lloh6:
	adrp	x23, _DMA_CTL0_BITS_PER_CH@GOTPAGE
Lloh7:
	ldr	x23, [x23, _DMA_CTL0_BITS_PER_CH@GOTPAGEOFF]
	ldr	w11, [x23]
	mul	w8, w11, w8
	lsl	w10, w10, w8
	bic	w24, w9, w10
Lloh8:
	adrp	x9, _DMA_CTL0_DIR_SHIFT_BITS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DMA_CTL0_DIR_SHIFT_BITS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	add	w8, w8, w9
	mov	w9, #1
	lsl	w25, w9, w8
Lloh11:
	adrp	x22, _CTL0@GOTPAGE
Lloh12:
	ldr	x22, [x22, _CTL0@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_dma_readl
	and	w8, w0, w25
	ldr	w9, [x23]
	ldr	w10, [x19]
	mul	w9, w10, w9
	lsl	w9, w21, w9
	orr	w8, w8, w24
	b	LBB0_3
LBB0_2:
	sub	w23, w8, #8
Lloh13:
	adrp	x8, _DMA_MASK_CTL2_MODE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_MASK_CTL2_MODE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _DMA_CTL0_MODE_MASK_BITS@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DMA_CTL0_MODE_MASK_BITS@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x24, _DMA_CTL0_BITS_PER_CH@GOTPAGE
Lloh20:
	ldr	x24, [x24, _DMA_CTL0_BITS_PER_CH@GOTPAGEOFF]
	ldr	w10, [x24]
	mul	w10, w10, w23
	lsl	w9, w9, w10
	bic	w25, w8, w9
Lloh21:
	adrp	x8, _DMA_CTL0_DIR_SHIFT_BITS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DMA_CTL0_DIR_SHIFT_BITS@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	add	w8, w10, w8
	mov	w9, #1
	lsl	w26, w9, w8
Lloh24:
	adrp	x22, _CTL3@GOTPAGE
Lloh25:
	ldr	x22, [x22, _CTL3@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_dma_readl
	and	w8, w0, w26
	ldr	w9, [x24]
	mul	w9, w9, w23
	lsl	w9, w21, w9
	orr	w8, w8, w25
LBB0_3:
	orr	w21, w8, w9
	ldr	w1, [x22]
	mov	x0, x20
	mov	x2, x21
	bl	_dma_writel
	mov	x0, x19
	bl	_chan2dev
	ldr	w2, [x19]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_dev_dbg
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_MASK_CTL0_MODE,4,2         ; @DMA_MASK_CTL0_MODE
	.comm	_DMA_CTL0_MODE_MASK_BITS,4,2    ; @DMA_CTL0_MODE_MASK_BITS
	.comm	_DMA_CTL0_BITS_PER_CH,4,2       ; @DMA_CTL0_BITS_PER_CH
	.comm	_DMA_CTL0_DIR_SHIFT_BITS,4,2    ; @DMA_CTL0_DIR_SHIFT_BITS
	.comm	_CTL0,4,2                       ; @CTL0
	.comm	_DMA_MASK_CTL2_MODE,4,2         ; @DMA_MASK_CTL2_MODE
	.comm	_CTL3,4,2                       ; @CTL3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pdc_set_mode: chan %d -> %x\n"

	.no_dead_strip	_pdc_set_mode
.subsections_via_symbols
