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

	.no_dead_strip	_pdc_set_dir
.subsections_via_symbols

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

	.no_dead_strip	_pdc_set_dir
.subsections_via_symbols
