	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ddb_dma_init
_ddb_dma_init:                          ## @ddb_dma_init
	.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, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r15
	xorl	%esi, %esi
	callq	_io_regmap
	movq	%rax, %rbx
	xorl	%eax, %eax
	testl	%r13d, %r13d
	setne	%al
	movq	8(%r15), %rcx
	movq	8(%rcx), %rcx
	movq	8(%rcx,%rax,8), %r12
	movslq	%r14d, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	imulq	$56, %rax, %r14
	leaq	(%r12,%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, 16(%r15)
	movq	%r15, 48(%r12,%r14)
	leaq	(%r12,%r14), %rdi
	addq	$40, %rdi
	callq	_spin_lock_init
	leaq	(%r12,%r14), %rdi
	addq	$36, %rdi
	callq	_init_waitqueue_head
	leaq	(%r12,%r14), %rdi
	addq	$32, %rdi
	testl	%r13d, %r13d
	je	LBB0_2
## %bb.1:
	movq	_output_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	16(%rbx), %rcx
	movq	24(%rbx), %rdx
	jmp	LBB0_3
LBB0_2:
	movq	_input_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
LBB0_3:
	movslq	(%rdx), %rax
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	imulq	%r13, %rax
	addq	8(%rdx), %rax
	leaq	8(%rcx), %rdx
	movslq	(%rcx), %rcx
	imulq	%r13, %rcx
	addq	(%rdx), %rcx
	movq	_dma_buf_size@GOTPCREL(%rip), %rdx
	imull	$6016, (%rdx), %edx             ## imm = 0x1780
	movq	_dma_buf_num@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	%rax, 16(%r12,%r14)
	movq	%rcx, 8(%r12,%r14)
	movq	%rsi, 24(%r12,%r14)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%edx, (%rdi)
	movl	$1, 4(%r12,%r14)
	movq	8(%r15), %rax
	movq	8(%rax), %rbx
	callq	_DMA_BUFFER_ACK
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_ddbwritel
	movq	8(%r15), %rax
	movq	8(%rax), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %edx
	movl	(%r15), %ecx
	movq	8(%r12,%r14), %rax
	movq	16(%r12,%r14), %r9
	movq	%rax, (%rsp)
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %r8d
	callq	_dev_dbg
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_output_work,4,2                ## @output_work
	.comm	_dma_buf_num,8,3                ## @dma_buf_num
	.comm	_dma_buf_size,4,2               ## @dma_buf_size
	.comm	_input_work,4,2                 ## @input_work
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"init link %u, io %u, dma %u, dmaregs %08x bufregs %08x\n"

	.no_dead_strip	_ddb_dma_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ddb_dma_init
_ddb_dma_init:                          ; @ddb_dma_init
	.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	x23, x2
	mov	x19, x1
	mov	x20, x0
	mov	w1, #0
	bl	_io_regmap
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8, #8]
	cmp	w23, #0
	mov	w9, #16
	mov	w10, #8
	csel	x9, x10, x9, eq
	ldr	x24, [x8, x9]
	sxtw	x25, w19
	mov	w8, #56
	smaddl	x21, w19, w8, x24
	str	x21, [x20, #16]
	str	x20, [x21, #48]
	add	x0, x21, #40
	bl	_spin_lock_init
	add	x0, x21, #36
	bl	_init_waitqueue_head
	add	x0, x21, #32
	cbz	w23, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _output_work@GOTPAGE
Lloh1:
	ldr	x8, [x8, _output_work@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_INIT_WORK
	ldp	x9, x8, [x22, #16]
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _input_work@GOTPAGE
Lloh4:
	ldr	x8, [x8, _input_work@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_INIT_WORK
	ldp	x9, x8, [x22]
LBB0_3:
	ldr	x10, [x8, #8]
	ldrsw	x8, [x8]
	mov	x11, x19
	sxtw	x11, w11
	madd	x8, x8, x11, x10
	add	x10, x9, #8
	ldr	x10, [x10]
	ldrsw	x9, [x9]
	mov	x11, x19
	sxtw	x11, w11
	madd	x9, x9, x11, x10
Lloh6:
	adrp	x10, _dma_buf_size@GOTPAGE
Lloh7:
	ldr	x10, [x10, _dma_buf_size@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	mov	w11, #6016
Lloh9:
	adrp	x12, _dma_buf_num@GOTPAGE
Lloh10:
	ldr	x12, [x12, _dma_buf_num@GOTPAGEOFF]
	mul	w10, w10, w11
Lloh11:
	ldr	x11, [x12]
	mov	w12, #56
	madd	x23, x25, x12, x24
	stp	x9, x8, [x23, #8]
	str	x11, [x23, #24]
	str	w10, [x21]
	mov	w8, #1
	str	w8, [x23, #4]
	ldr	x8, [x20, #8]
	ldr	x22, [x8, #8]
	mov	x0, x21
	bl	_DMA_BUFFER_ACK
	mov	x2, x0
	mov	x0, x22
	mov	w1, #0
	bl	_ddbwritel
	ldr	x8, [x20, #8]
	ldr	x9, [x8, #8]
	ldr	w0, [x9]
	ldr	w2, [x8]
	ldr	w3, [x20]
	ldp	x6, x5, [x23, #8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x4, x19
	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
	b	_dev_dbg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_output_work,4,2                ; @output_work
	.comm	_dma_buf_num,8,3                ; @dma_buf_num
	.comm	_dma_buf_size,4,2               ; @dma_buf_size
	.comm	_input_work,4,2                 ; @input_work
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"init link %u, io %u, dma %u, dmaregs %08x bufregs %08x\n"

	.no_dead_strip	_ddb_dma_init
.subsections_via_symbols
