	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function generate_ndma_promise
_generate_ndma_promise:                 ## @generate_ndma_promise
	.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	%r8, %r14
	movq	%rcx, %r12
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	%r8, %rdi
	movl	%r9d, %esi
	callq	_sanitize_config
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %rbx
	movq	%r15, 24(%rax)
	movq	%r13, 16(%rax)
	movq	%r12, (%rax)
	movq	_SUN4I_DMA_CFG_LOADING@GOTPCREL(%rip), %rax
	movq	_SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_chan2dev
	movl	12(%r14), %edx
	movl	8(%r14), %ecx
	movl	(%r14), %r9d
	movl	4(%r14), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_dbg
	movl	12(%r14), %edi
	callq	_convert_burst
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movl	%eax, %edi
	callq	_SUN4I_DMA_CFG_SRC_BURST_LENGTH
	orl	%eax, 8(%rbx)
	movl	8(%r14), %edi
	callq	_convert_burst
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	movl	%eax, %edi
	callq	_SUN4I_DMA_CFG_DST_BURST_LENGTH
	orl	%eax, 8(%rbx)
	movl	4(%r14), %edi
	callq	_convert_buswidth
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movl	%eax, %edi
	callq	_SUN4I_DMA_CFG_SRC_DATA_WIDTH
	orl	%eax, 8(%rbx)
	movl	(%r14), %edi
	callq	_convert_buswidth
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movl	%eax, %edi
	callq	_SUN4I_DMA_CFG_DST_DATA_WIDTH
	orl	%eax, 8(%rbx)
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.comm	_SUN4I_DMA_CFG_LOADING,4,2      ## @SUN4I_DMA_CFG_LOADING
	.comm	_SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN,4,2 ## @SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"src burst %d, dst burst %d, src buswidth %d, dst buswidth %d"

	.no_dead_strip	_generate_ndma_promise
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function generate_ndma_promise
_generate_ndma_promise:                 ; @generate_ndma_promise
	.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	x20, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x21, x0
	mov	x0, x4
	mov	x1, x5
	bl	_sanitize_config
	cbnz	w0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _GFP_NOWAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOWAIT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.2:
	stp	x23, x24, [x19, #16]
	str	x22, [x19]
Lloh3:
	adrp	x8, _SUN4I_DMA_CFG_LOADING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SUN4I_DMA_CFG_LOADING@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	mov	x0, x21
	bl	_chan2dev
	ldp	w3, w2, [x20, #8]
	ldp	w5, w4, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x20, #12]
	bl	_convert_burst
	tbnz	w0, #31, LBB0_7
; %bb.3:
	bl	_SUN4I_DMA_CFG_SRC_BURST_LENGTH
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	str	w8, [x19, #8]
	ldr	w0, [x20, #8]
	bl	_convert_burst
	tbnz	w0, #31, LBB0_7
; %bb.4:
	bl	_SUN4I_DMA_CFG_DST_BURST_LENGTH
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	str	w8, [x19, #8]
	ldr	w0, [x20, #4]
	bl	_convert_buswidth
	tbnz	w0, #31, LBB0_7
; %bb.5:
	bl	_SUN4I_DMA_CFG_SRC_DATA_WIDTH
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	str	w8, [x19, #8]
	ldr	w0, [x20]
	bl	_convert_buswidth
	tbnz	w0, #31, LBB0_7
; %bb.6:
	bl	_SUN4I_DMA_CFG_DST_DATA_WIDTH
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	str	w8, [x19, #8]
	b	LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_kfree
LBB0_8:
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.comm	_SUN4I_DMA_CFG_LOADING,4,2      ; @SUN4I_DMA_CFG_LOADING
	.comm	_SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN,4,2 ; @SUN4I_NDMA_CFG_BYTE_COUNT_MODE_REMAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"src burst %d, dst burst %d, src buswidth %d, dst buswidth %d"

	.no_dead_strip	_generate_ndma_promise
.subsections_via_symbols
