	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ep93xx_dma_alloc_chan_resources
_ep93xx_dma_alloc_chan_resources:       ## @ep93xx_dma_alloc_chan_resources
	.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_ep93xx_dma_chan
	movq	%rax, %r14
	movq	(%r15), %rbx
	movq	%r15, %rdi
	callq	_dma_chan_name
	movq	%rax, %r12
	movq	16(%r14), %rax
	cmpl	$0, 8(%rax)
	je	LBB0_1
## %bb.6:
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.7:
	movl	(%rbx), %eax
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_2
## %bb.8:
	movq	8(%rbx), %rdi
	callq	_is_slave_direction
	testl	%eax, %eax
	jne	LBB0_9
	jmp	LBB0_2
LBB0_1:
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	movl	(%rbx), %eax
	movq	_EP93XX_DMA_I2S1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jl	LBB0_2
## %bb.4:
	movq	_EP93XX_DMA_IRDA@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_2
## %bb.5:
	movq	8(%rbx), %r13
	movq	%r15, %rdi
	callq	_ep93xx_dma_chan_direction
	cmpq	%rax, %r13
	jne	LBB0_2
LBB0_9:
	movq	16(%rbx), %rax
	testq	%rax, %rax
	cmovneq	%rax, %r12
LBB0_10:
	movl	(%r14), %edi
	callq	_clk_enable
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.11:
	movl	4(%r14), %edi
	movq	_ep93xx_dma_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movq	%r14, %r8
	callq	_request_irq
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_20
## %bb.12:
	leaq	8(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	%r14, %rdi
	addq	$24, %rdi
	callq	_dma_cookie_init
	movq	16(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.19:
	movl	4(%r14), %edi
	movq	%r14, %rsi
	callq	_free_irq
LBB0_20:
	movl	(%r14), %edi
	callq	_clk_disable
	jmp	LBB0_21
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_21:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_DMA_MAX_CHAN_DESCRIPTORS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_14
## %bb.15:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_dma_async_tx_descriptor_init
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_ep93xx_dma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ep93xx_dma_desc_put
	incl	%r13d
	cmpl	(%r12), %r13d
	jl	LBB0_16
	jmp	LBB0_21
LBB0_14:
	xorl	%r13d, %r13d
	jmp	LBB0_21
LBB0_17:
	movq	%r14, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_warn
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EP93XX_DMA_I2S1,4,2            ## @EP93XX_DMA_I2S1
	.comm	_EP93XX_DMA_IRDA,4,2            ## @EP93XX_DMA_IRDA
	.comm	_ep93xx_dma_interrupt,4,2       ## @ep93xx_dma_interrupt
	.comm	_DMA_MAX_CHAN_DESCRIPTORS,4,2   ## @DMA_MAX_CHAN_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not enough descriptors\n"

	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_ep93xx_dma_tx_submit,4,2       ## @ep93xx_dma_tx_submit
	.no_dead_strip	_ep93xx_dma_alloc_chan_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ep93xx_dma_alloc_chan_resources
_ep93xx_dma_alloc_chan_resources:       ; @ep93xx_dma_alloc_chan_resources
	.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	x20, x0
	bl	_to_ep93xx_dma_chan
	mov	x19, x0
	ldr	x21, [x20]
	mov	x0, x20
	bl	_dma_chan_name
	mov	x22, x0
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_4
; %bb.1:
	cbz	x21, LBB0_8
; %bb.2:
	ldr	w8, [x21]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.3:
	ldr	x0, [x21, #8]
	bl	_is_slave_direction
	cbnz	w0, LBB0_7
	b	LBB0_13
LBB0_4:
	cbz	x21, LBB0_13
; %bb.5:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _EP93XX_DMA_I2S1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EP93XX_DMA_I2S1@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _EP93XX_DMA_IRDA@GOTPAGE
Lloh4:
	ldr	x10, [x10, _EP93XX_DMA_IRDA@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #0, ge
	b.gt	LBB0_13
; %bb.6:
	ldr	x23, [x21, #8]
	mov	x0, x20
	bl	_ep93xx_dma_chan_direction
	cmp	x23, x0
	b.ne	LBB0_13
LBB0_7:
	ldr	x8, [x21, #16]
	cmp	x8, #0
	csel	x22, x22, x8, eq
LBB0_8:
	ldr	w0, [x19]
	bl	_clk_enable
	mov	x21, x0
	cbnz	w0, LBB0_14
; %bb.9:
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x8, _ep93xx_dma_interrupt@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ep93xx_dma_interrupt@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w2, #0
	mov	x3, x22
	mov	x4, x19
	bl	_request_irq
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.10:
	add	x22, x19, #8
	mov	x0, x22
	bl	_spin_lock_irq
	add	x0, x19, #24
	bl	_dma_cookie_init
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x21, x0
	mov	x0, x22
	bl	_spin_unlock_irq
	cbz	w21, LBB0_15
; %bb.11:
	ldr	w0, [x19, #4]
	mov	x1, x19
	bl	_free_irq
LBB0_12:
	ldr	w0, [x19]
	bl	_clk_disable
	b	LBB0_14
LBB0_13:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_14:
	mov	x0, 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
	ret
LBB0_15:
Lloh12:
	adrp	x23, _DMA_MAX_CHAN_DESCRIPTORS@GOTPAGE
Lloh13:
	ldr	x23, [x23, _DMA_MAX_CHAN_DESCRIPTORS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.16:
	mov	w21, #0
Lloh14:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
Lloh16:
	adrp	x25, _DMA_CTRL_ACK@GOTPAGE
Lloh17:
	ldr	x25, [x25, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh18:
	adrp	x26, _ep93xx_dma_tx_submit@GOTPAGE
Lloh19:
	ldr	x26, [x26, _ep93xx_dma_tx_submit@GOTPAGEOFF]
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	w0, #12
	bl	_kzalloc
	cbz	x0, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x22, x0
	add	x0, x0, #8
	bl	_INIT_LIST_HEAD
	mov	x0, x22
	mov	x1, x20
	bl	_dma_async_tx_descriptor_init
	ldr	w8, [x25]
	ldr	w9, [x26]
	stp	w9, w8, [x22]
	mov	x0, x19
	mov	x1, x22
	bl	_ep93xx_dma_desc_put
	add	w21, w21, #1
	ldr	w8, [x23]
	cmp	w21, w8
	b.lt	LBB0_17
	b	LBB0_14
LBB0_19:
	mov	w21, #0
	b	LBB0_14
LBB0_20:
	mov	x0, x19
	bl	_chan2dev
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EP93XX_DMA_I2S1,4,2            ; @EP93XX_DMA_I2S1
	.comm	_EP93XX_DMA_IRDA,4,2            ; @EP93XX_DMA_IRDA
	.comm	_ep93xx_dma_interrupt,4,2       ; @ep93xx_dma_interrupt
	.comm	_DMA_MAX_CHAN_DESCRIPTORS,4,2   ; @DMA_MAX_CHAN_DESCRIPTORS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not enough descriptors\n"

	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_ep93xx_dma_tx_submit,4,2       ; @ep93xx_dma_tx_submit
	.no_dead_strip	_ep93xx_dma_alloc_chan_resources
.subsections_via_symbols
