	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d40_allocate_channel
_d40_allocate_channel:                  ## @d40_allocate_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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movl	24(%rdi), %r12d
	movq	32(%rdi), %r15
	movq	_STEDMA40_MODE_LOGICAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	xorl	%r14d, %r14d
	cmpq	%rbx, %r15
	sete	%al
	movq	16(%rdi), %rcx
	movq	24(%rcx), %rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rcx), %ecx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	40(%rdi), %rdx
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -120(%rbp)                ## 8-byte Spill
	cmpq	%rcx, %rdx
	jne	LBB0_2
## %bb.1:
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	leal	(%r12,%r12), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_5
LBB0_2:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	je	LBB0_4
## %bb.3:
	movq	_DMA_MEM_TO_MEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_37
LBB0_4:
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	leal	(%r12,%r12), %ecx
	incl	%ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_5:
	movb	%al, %r14b
	movl	%r12d, %edi
	callq	_D40_TYPE_TO_GROUP
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	callq	_D40_TYPE_TO_EVENT
	cmpq	%rbx, %r15
	jne	LBB0_6
## %bb.19:
	cmpl	$-1, %r12d
	je	LBB0_37
## %bb.20:
	movl	%eax, %edx
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	movq	16(%r13), %rax
	cmpl	$0, (%rax)
	jle	LBB0_37
## %bb.21:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %ecx
	addl	%eax, %ecx
	leal	(%rax,%rax), %esi
	incl	%esi
	movslq	%ecx, %rax
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	xorl	%edi, %edi
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movl	%r14d, -64(%rbp)                ## 4-byte Spill
LBB0_22:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_32 Depth 2
	movq	-136(%rbp), %rax                ## 8-byte Reload
	leaq	(%rdi,%rax), %r15
	cmpq	$0, 56(%r13)
	jne	LBB0_23
## %bb.30:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	%rdi, -144(%rbp)                ## 8-byte Spill
	movq	-120(%rbp), %rax                ## 8-byte Reload
	cmpq	%rax, -128(%rbp)                ## 8-byte Folded Reload
	movl	%ecx, -88(%rbp)                 ## 4-byte Spill
	movl	%esi, -80(%rbp)                 ## 4-byte Spill
	jne	LBB0_31
## %bb.34:                              ##   in Loop: Header=BB0_22 Depth=1
	movslq	%ecx, %r12
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	(%r14,%r12,8), %rdi
	movl	$1, %esi
	movl	%edx, %ebx
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %r8
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	jne	LBB0_38
## %bb.35:                              ##   in Loop: Header=BB0_22 Depth=1
	orq	$1, %r12
	leaq	(%r14,%r12,8), %rdi
	movl	$1, %esi
	movl	%ebx, %edx
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	movq	%r15, %r8
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	movl	%ebx, %edx
	je	LBB0_36
	jmp	LBB0_38
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_22 Depth=1
	movslq	%esi, %r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r13,8), %rbx
	incq	%r13
	movl	%esi, %r12d
	.p2align	4, 0x90
LBB0_32:                                ##   Parent Loop BB0_22 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%edx, %r14d
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	jne	LBB0_38
## %bb.33:                              ##   in Loop: Header=BB0_32 Depth=2
	decl	%r12d
	decq	%r13
	addq	$-8, %rbx
	cmpq	%r15, %r13
	movl	%r14d, %edx
	jg	LBB0_32
LBB0_36:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	-144(%rbp), %rdi                ## 8-byte Reload
	addq	$8, %rdi
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	16(%r13), %rax
	movslq	(%rax), %rax
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	addl	$8, %esi
	movl	-88(%rbp), %ecx                 ## 4-byte Reload
	addl	$8, %ecx
	cmpq	%rax, %rdi
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	movl	-64(%rbp), %r14d                ## 4-byte Reload
	jl	LBB0_22
	jmp	LBB0_37
LBB0_6:
	movq	40(%r13), %rax
	movq	_DMA_MEM_TO_MEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	jne	LBB0_7
## %bb.12:
	cmpq	$0, 56(%r13)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_13
## %bb.45:
	movslq	48(%r13), %r12
	leaq	(%rax,%r12,8), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	%r14d, %ecx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	jne	LBB0_46
	jmp	LBB0_37
LBB0_7:
	movq	16(%r13), %rax
	cmpl	$0, (%rax)
	jle	LBB0_37
## %bb.8:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %eax
	xorl	%ecx, %ecx
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, %edx
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -104(%rbp)                ## 8-byte Spill
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movslq	%edx, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r15,8), %rbx
	decq	%r15
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	addl	%ecx, %eax
	orl	$1, %eax
	movslq	%eax, %r13
	movl	%edx, -120(%rbp)                ## 4-byte Spill
	movl	%edx, %r12d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	%r14d, %ecx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	jne	LBB0_11
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=2
	incl	%r12d
	incq	%r15
	addq	$8, %rbx
	cmpq	%r13, %r15
	jl	LBB0_10
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	addq	$8, %rcx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	16(%r13), %rax
	movslq	(%rax), %rax
	movl	-120(%rbp), %edx                ## 4-byte Reload
	addl	$8, %edx
	cmpq	%rax, %rcx
	jl	LBB0_9
	jmp	LBB0_37
LBB0_38:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-104(%rbp), %r15                ## 8-byte Reload
	movq	-112(%rbp), %rbx                ## 8-byte Reload
LBB0_39:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movslq	%r12d, %rax
	leaq	(%rdx,%rax,8), %rcx
	movq	%rcx, 8(%r13)
	jmp	LBB0_40
LBB0_11:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-104(%rbp), %r15                ## 8-byte Reload
LBB0_46:
	movslq	%r12d, %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rax,8), %rcx
	movq	%rcx, 8(%r13)
	movq	_D40_PHY_CHAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	-112(%rbp), %rbx                ## 8-byte Reload
LBB0_40:
	movl	%esi, (%r13)
	movq	16(%r13), %rcx
	cmpq	%rbx, %r15
	jne	LBB0_42
## %bb.41:
	movq	16(%rcx), %rax
	movslq	%esi, %rcx
	movq	%r13, (%rax,%rcx,8)
	jmp	LBB0_43
LBB0_42:
	movq	8(%rcx), %rcx
	movq	(%rdx,%rax,8), %rax
	movq	%r13, (%rcx,%rax,8)
LBB0_43:
	xorl	%eax, %eax
	jmp	LBB0_44
LBB0_13:
	cmpl	$0, -88(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_37
## %bb.14:
	xorl	%r12d, %r12d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	%r14d, %ecx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	jne	LBB0_46
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	incq	%r12
	addq	$8, %rbx
	cmpq	%r12, -88(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_15
	jmp	LBB0_37
LBB0_23:
	movl	48(%r13), %r12d
	cmpl	%r15d, %r12d
	je	LBB0_27
## %bb.24:
	orl	$1, %r15d
	cmpl	%r15d, %r12d
	je	LBB0_27
## %bb.25:
	movq	%r13, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_26
LBB0_27:
	movslq	%r12d, %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,8), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %ecx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	callq	_d40_alloc_mask_set
	testq	%rax, %rax
	je	LBB0_29
## %bb.28:
	movq	-104(%rbp), %r15                ## 8-byte Reload
	jmp	LBB0_39
LBB0_29:
	movq	%r13, %rdi
	callq	_chan2dev
	leaq	L_.str.1(%rip), %rsi
LBB0_26:
	movl	%eax, %edi
	movl	%r12d, %edx
	callq	_dev_err
LBB0_37:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_44:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STEDMA40_MODE_LOGICAL,8,3      ## @STEDMA40_MODE_LOGICAL
	.comm	_DMA_DEV_TO_MEM,8,3             ## @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,8,3             ## @DMA_MEM_TO_DEV
	.comm	_DMA_MEM_TO_MEM,8,3             ## @DMA_MEM_TO_MEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_D40_PHY_CHAN,4,2               ## @D40_PHY_CHAN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid fixed phy channel %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"could not allocate fixed phy channel %d\n"

	.no_dead_strip	_d40_allocate_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d40_allocate_channel
_d40_allocate_channel:                  ; @d40_allocate_channel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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, x1
	mov	x19, x0
	ldr	w24, [x0, #24]
Lloh0:
	adrp	x8, _STEDMA40_MODE_LOGICAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STEDMA40_MODE_LOGICAL@GOTPAGEOFF]
Lloh2:
	ldr	x28, [x8]
	ldp	x22, x10, [x0, #32]
	cmp	x22, x28
	cset	w21, eq
	ldr	x8, [x0, #16]
	ldr	x26, [x8, #24]
	ldr	w27, [x8]
Lloh3:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [sp, #64]                   ; 8-byte Folded Spill
	cmp	x10, x8
	b.ne	LBB0_2
; %bb.1:
	str	x10, [sp, #48]                  ; 8-byte Folded Spill
	lsl	w8, w24, #1
	str	w8, [sp, #36]                   ; 4-byte Folded Spill
	mov	w8, #1
	str	w8, [sp, #76]                   ; 4-byte Folded Spill
	b	LBB0_4
LBB0_2:
Lloh6:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _DMA_MEM_TO_MEM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DMA_MEM_TO_MEM@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x10, x8
	ccmp	x10, x9, #4, ne
	b.ne	LBB0_42
; %bb.3:
	str	x10, [sp, #48]                  ; 8-byte Folded Spill
	str	wzr, [sp, #76]                  ; 4-byte Folded Spill
	mov	w8, #1
	bfi	w8, w24, #1, #31
	str	w8, [sp, #36]                   ; 4-byte Folded Spill
LBB0_4:
	mov	x0, x24
	bl	_D40_TYPE_TO_GROUP
	mov	x25, x0
	mov	x0, x24
	bl	_D40_TYPE_TO_EVENT
	cmp	x22, x28
	b.ne	LBB0_16
; %bb.5:
	cmn	w24, #1
	b.eq	LBB0_42
; %bb.6:
	str	x22, [sp, #40]                  ; 8-byte Folded Spill
	str	x28, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_42
; %bb.7:
	mov	x23, x0
	mov	x28, #0
	lsl	w8, w25, #1
	mov	w27, #1
	bfi	w27, w25, #1, #31
	sxtw	x9, w8
	str	x9, [sp, #16]                   ; 8-byte Folded Spill
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x26, [sp, #56]                  ; 8-byte Folded Spill
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	add	x22, x28, x9
	ldr	x9, [x19, #56]
	cbnz	x9, LBB0_37
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	sxtw	x24, w8
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	ldr	x9, [sp, #64]                   ; 8-byte Folded Reload
	cmp	x8, x9
	str	x24, [sp, #24]                  ; 8-byte Folded Spill
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x0, x26, x24, lsl #3
	mov	w1, #1
	mov	x2, x23
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
	cbnz	x0, LBB0_45
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	orr	x22, x24, #0x1
	add	x0, x26, x22, lsl #3
	mov	w1, #1
	mov	x2, x23
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
	cbz	x0, LBB0_15
	b	LBB0_44
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	sxtw	x8, w27
	mov	x9, x26
	add	x26, x8, #1
	add	x25, x9, w27, sxtw #3
	mov	x24, x27
LBB0_13:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x25
	mov	w1, #0
	mov	x2, x23
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
	cbnz	x0, LBB0_27
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	sub	w24, w24, #1
	sub	x26, x26, #1
	sub	x25, x25, #8
	cmp	x26, x22
	b.gt	LBB0_13
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x28, x28, #8
	ldr	x8, [x19, #16]
	ldrsw	x9, [x8]
	add	w27, w27, #8
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	add	w8, w8, #8
	cmp	x28, x9
	ldr	x26, [sp, #56]                  ; 8-byte Folded Reload
	b.lt	LBB0_8
	b	LBB0_42
LBB0_16:
	ldr	x8, [x19, #40]
Lloh12:
	adrp	x9, _DMA_MEM_TO_MEM@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DMA_MEM_TO_MEM@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	str	x22, [sp, #40]                  ; 8-byte Folded Spill
	str	x26, [sp, #56]                  ; 8-byte Folded Spill
	b.ne	LBB0_19
; %bb.17:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_32
; %bb.18:
	ldrsw	x22, [x19, #48]
	add	x0, x26, x22, lsl #3
	ldr	w1, [sp, #76]                   ; 4-byte Folded Reload
	mov	w2, #0
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	cbnz	x0, LBB0_26
	b	LBB0_42
LBB0_19:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_42
; %bb.20:
	mov	x24, #0
	lsl	w9, w25, #1
	mov	x26, x9
	str	w9, [sp, #64]                   ; 4-byte Folded Spill
LBB0_21:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	mov	x25, x28
	sxtw	x8, w26
	sub	x27, x8, #1
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	add	x23, x8, w26, sxtw #3
	add	w8, w9, w24
	orr	w8, w8, #0x1
	sxtw	x28, w8
	mov	x22, x26
LBB0_22:                                ;   Parent Loop BB0_21 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x23
	ldr	w1, [sp, #76]                   ; 4-byte Folded Reload
	mov	w2, #0
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
	cbnz	x0, LBB0_25
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=2
	add	w22, w22, #1
	add	x27, x27, #1
	add	x23, x23, #8
	cmp	x27, x28
	b.lt	LBB0_22
; %bb.24:                               ;   in Loop: Header=BB0_21 Depth=1
	add	x24, x24, #8
	ldr	x8, [x19, #16]
	ldrsw	x8, [x8]
	add	w26, w26, #8
	cmp	x24, x8
	mov	x28, x25
	ldr	w9, [sp, #64]                   ; 4-byte Folded Reload
	b.lt	LBB0_21
	b	LBB0_42
LBB0_25:
	mov	x28, x25
LBB0_26:
	sxtw	x8, w22
	ldr	x26, [sp, #56]                  ; 8-byte Folded Reload
	add	x9, x26, w22, sxtw #3
	str	x9, [x19, #8]
Lloh15:
	adrp	x9, _D40_PHY_CHAN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _D40_PHY_CHAN@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x9]
	ldr	x10, [sp, #40]                  ; 8-byte Folded Reload
	b	LBB0_29
LBB0_27:
	ldr	x28, [sp, #8]                   ; 8-byte Folded Reload
	ldr	x10, [sp, #40]                  ; 8-byte Folded Reload
	ldr	x26, [sp, #56]                  ; 8-byte Folded Reload
LBB0_28:
	ldr	w11, [sp, #36]                  ; 4-byte Folded Reload
	sxtw	x8, w24
	add	x9, x26, w24, sxtw #3
	str	x9, [x19, #8]
LBB0_29:
	str	w11, [x19]
	ldr	x9, [x19, #16]
	cmp	x10, x28
	b.ne	LBB0_31
; %bb.30:
	mov	w0, #0
	ldr	x8, [x9, #16]
	str	x19, [x8, w11, sxtw #3]
	b	LBB0_43
LBB0_31:
	mov	w0, #0
	ldr	x9, [x9, #8]
	ldr	x8, [x26, x8, lsl #3]
	str	x19, [x9, x8, lsl #3]
	b	LBB0_43
LBB0_32:
	cmp	w27, #1
	b.lt	LBB0_42
; %bb.33:
	mov	x22, #0
	ldr	x23, [sp, #56]                  ; 8-byte Folded Reload
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	ldr	w1, [sp, #76]                   ; 4-byte Folded Reload
	mov	w2, #0
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
	cbnz	x0, LBB0_36
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	add	x22, x22, #1
	add	x23, x23, #8
	cmp	x27, x22
	b.ne	LBB0_34
	b	LBB0_42
LBB0_36:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_26
LBB0_37:
	ldr	w24, [x19, #48]
	orr	w8, w22, #0x1
	cmp	w24, w22
	ccmp	w24, w8, #4, ne
	b.ne	LBB0_40
; %bb.38:
	mov	x8, x24
	sxtw	x8, w8
	add	x0, x26, x8, lsl #3
	ldr	w1, [sp, #76]                   ; 4-byte Folded Reload
	mov	x2, x23
	mov	x3, x21
	mov	x4, x20
	bl	_d40_alloc_mask_set
	cbnz	x0, LBB0_46
; %bb.39:
	mov	x0, x19
	bl	_chan2dev
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_41
LBB0_40:
	mov	x0, x19
	bl	_chan2dev
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
LBB0_41:
	mov	x2, x24
	bl	_dev_err
LBB0_42:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_43:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_44:
	mov	x24, x22
	ldr	x26, [sp, #56]                  ; 8-byte Folded Reload
LBB0_45:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
LBB0_46:
	ldr	x28, [sp, #8]                   ; 8-byte Folded Reload
	ldr	x10, [sp, #40]                  ; 8-byte Folded Reload
	b	LBB0_28
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_STEDMA40_MODE_LOGICAL,8,3      ; @STEDMA40_MODE_LOGICAL
	.comm	_DMA_DEV_TO_MEM,8,3             ; @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,8,3             ; @DMA_MEM_TO_DEV
	.comm	_DMA_MEM_TO_MEM,8,3             ; @DMA_MEM_TO_MEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_D40_PHY_CHAN,4,2               ; @D40_PHY_CHAN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid fixed phy channel %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"could not allocate fixed phy channel %d\n"

	.no_dead_strip	_d40_allocate_channel
.subsections_via_symbols
