	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function coh901318_dma_set_runtimeconfig
_coh901318_dma_set_runtimeconfig:       ## @coh901318_dma_set_runtimeconfig
	.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	%edx, %ebx
	movq	%rsi, %r15
	callq	_to_coh901318_chan
	movq	%rax, %r14
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	20(%r15), %rax
	movq	%r15, %rcx
	addq	$4, %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_11
## %bb.3:
	leaq	16(%r15), %rax
	movq	%r15, %rcx
	addq	$8, %r15
	addq	$12, %rcx
LBB0_4:
	movl	(%rcx), %r12d
	movl	(%r15), %ebx
	movl	(%rax), %r15d
	movq	%r14, %rdi
	callq	_COHC_2_DEV
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpl	$128, %ebx
	je	LBB0_12
## %bb.5:
	cmpl	$129, %ebx
	je	LBB0_16
## %bb.6:
	cmpl	$130, %ebx
	jne	LBB0_20
## %bb.7:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS@GOTPCREL(%rip), %rax
	movq	_COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movq	_burst_sizes@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jle	LBB0_24
## %bb.8:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	%r12d, (%rdi,%r15)
	jle	LBB0_25
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %r15
	cmpq	%rax, %rbx
	jl	LBB0_9
	jmp	LBB0_25
LBB0_11:
	movq	%r14, %rdi
	callq	_COHC_2_DEV
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_21
LBB0_12:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS@GOTPCREL(%rip), %rax
	movq	_COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movq	_burst_sizes@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jle	LBB0_24
## %bb.13:
	movl	$8, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	%r12d, (%rdi,%r15)
	jle	LBB0_25
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %r15
	cmpq	%rax, %rbx
	jl	LBB0_14
	jmp	LBB0_25
LBB0_16:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS@GOTPCREL(%rip), %rax
	movq	_COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movq	_burst_sizes@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jle	LBB0_24
## %bb.17:
	movl	$4, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	%r12d, (%rdi,%r15)
	jle	LBB0_25
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %r15
	cmpq	%rax, %rbx
	jl	LBB0_18
	jmp	LBB0_25
LBB0_24:
	xorl	%ebx, %ebx
LBB0_25:
	movq	_burst_sizes@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	%ebx, %ebx
	shlq	$4, %rbx
	orl	12(%rax,%rbx), %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_COHC_2_DEV
	movq	(%r14), %rcx
	movl	(%rcx,%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%eax, %edi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r15)
	movl	%r13d, (%r15)
	jmp	LBB0_26
LBB0_20:
	movq	%r14, %rdi
	callq	_COHC_2_DEV
	leaq	L_.str.2(%rip), %rsi
LBB0_21:
	movl	%eax, %edi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"illegal channel mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"configure channel for %d byte transfers\n"

	.comm	_COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS,4,2 ## @COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS
	.comm	_COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS,4,2 ## @COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS
	.comm	_burst_sizes,8,3                ## @burst_sizes
	.comm	_COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS,4,2 ## @COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS
	.comm	_COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS,4,2 ## @COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS
	.comm	_COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS,4,2 ## @COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS
	.comm	_COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS,4,2 ## @COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS
L_.str.2:                               ## @.str.2
	.asciz	"bad runtimeconfig: alien address width\n"

L_.str.3:                               ## @.str.3
	.asciz	"selected burst size %d bytes for address width %d bytes, maxburst %d\n"

	.no_dead_strip	_coh901318_dma_set_runtimeconfig
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function coh901318_dma_set_runtimeconfig
_coh901318_dma_set_runtimeconfig:       ; @coh901318_dma_set_runtimeconfig
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x20, x1
	bl	_to_coh901318_chan
	mov	x19, x0
Lloh0:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_2
; %bb.1:
	add	x8, x20, #20
	add	x9, x20, #4
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_11
; %bb.3:
	add	x8, x20, #16
	add	x9, x20, #12
	add	x20, x20, #8
LBB0_4:
	ldr	w22, [x9]
	ldr	w20, [x20]
	ldr	w21, [x8]
	mov	x0, x19
	bl	_COHC_2_DEV
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	cmp	w20, #128
	b.eq	LBB0_12
; %bb.5:
	cmp	w20, #129
	b.eq	LBB0_16
; %bb.6:
	cmp	w20, #130
	b.ne	LBB0_22
; %bb.7:
Lloh8:
	adrp	x8, _COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS@GOTPAGEOFF]
Lloh10:
	adrp	x9, _COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS@GOTPAGE
Lloh11:
	ldr	x9, [x9, _COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	orr	w23, w9, w8
Lloh14:
	adrp	x25, _burst_sizes@GOTPAGE
Lloh15:
	ldr	x25, [x25, _burst_sizes@GOTPAGEOFF]
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_20
; %bb.8:
	mov	x26, #0
	mov	x24, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	ldr	w8, [x0, x26]
	cmp	w8, w22
	b.le	LBB0_21
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	add	x26, x26, #16
	cmp	x24, w0, sxtw
	b.lt	LBB0_9
	b	LBB0_21
LBB0_11:
	mov	x0, x19
	bl	_COHC_2_DEV
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_23
LBB0_12:
Lloh18:
	adrp	x8, _COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS@GOTPAGEOFF]
Lloh20:
	adrp	x9, _COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS@GOTPAGE
Lloh21:
	ldr	x9, [x9, _COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	ldr	w9, [x9]
	orr	w23, w9, w8
Lloh24:
	adrp	x25, _burst_sizes@GOTPAGE
Lloh25:
	ldr	x25, [x25, _burst_sizes@GOTPAGEOFF]
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_20
; %bb.13:
	mov	x24, #0
	mov	w26, #8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	ldr	w8, [x0, x26]
	cmp	w8, w22
	b.le	LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	add	x26, x26, #16
	cmp	x24, w0, sxtw
	b.lt	LBB0_14
	b	LBB0_21
LBB0_16:
Lloh26:
	adrp	x8, _COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS@GOTPAGEOFF]
Lloh28:
	adrp	x9, _COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS@GOTPAGE
Lloh29:
	ldr	x9, [x9, _COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	ldr	w9, [x9]
	orr	w23, w9, w8
Lloh32:
	adrp	x25, _burst_sizes@GOTPAGE
Lloh33:
	ldr	x25, [x25, _burst_sizes@GOTPAGEOFF]
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_20
; %bb.17:
	mov	x24, #0
	mov	w26, #4
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	ldr	w8, [x0, x26]
	cmp	w8, w22
	b.le	LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	add	x26, x26, #16
	cmp	x24, w0, sxtw
	b.lt	LBB0_18
	b	LBB0_21
LBB0_20:
	mov	x24, #0
LBB0_21:
Lloh34:
	adrp	x25, _burst_sizes@GOTPAGE
Lloh35:
	ldr	x25, [x25, _burst_sizes@GOTPAGEOFF]
	ldr	x8, [x25]
	ubfiz	x24, x24, #4, #32
	add	x8, x8, x24
	ldr	w8, [x8, #12]
	orr	w23, w8, w23
	mov	x0, x19
	bl	_COHC_2_DEV
	ldr	x8, [x25]
	ldr	w2, [x8, x24]
	stp	x20, x22, [sp]
Lloh36:
	adrp	x1, l_.str.3@PAGE
Lloh37:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	mov	w0, #0
	stp	w23, w21, [x19]
	b	LBB0_24
LBB0_22:
	mov	x0, x19
	bl	_COHC_2_DEV
Lloh38:
	adrp	x1, l_.str.2@PAGE
Lloh39:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_23:
	bl	_dev_err
Lloh40:
	adrp	x8, _EINVAL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_24:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"illegal channel mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"configure channel for %d byte transfers\n"

	.comm	_COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS,4,2 ; @COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS
	.comm	_COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS,4,2 ; @COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS
	.comm	_burst_sizes,8,3                ; @burst_sizes
	.comm	_COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS,4,2 ; @COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS
	.comm	_COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS,4,2 ; @COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS
	.comm	_COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS,4,2 ; @COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS
	.comm	_COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS,4,2 ; @COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS
l_.str.2:                               ; @.str.2
	.asciz	"bad runtimeconfig: alien address width\n"

l_.str.3:                               ; @.str.3
	.asciz	"selected burst size %d bytes for address width %d bytes, maxburst %d\n"

	.no_dead_strip	_coh901318_dma_set_runtimeconfig
.subsections_via_symbols
