	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function a10dmac_attach
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_a10dmac_attach:                        ## @a10dmac_attach
	.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	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r12
	movq	_a10dmac_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r12), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_17
LBB0_3:
	movq	_MTX_SPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	leaq	-44(%rbp), %rcx
	movl	%r14d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_clk_get_by_ofw_index
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_6:
	movl	-44(%rbp), %edi
	callq	_clk_enable
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
LBB0_5:
	movl	%r14d, %edi
	callq	_device_printf
LBB0_17:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_AWIN_DMA_IRQ_EN_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_DMA_WRITE
	movq	_AWIN_DMA_IRQ_PEND_STA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_DMA_WRITE
	movq	_NDMA_CHANNELS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_11
## %bb.9:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movq	%r12, 32(%rax,%r13)
	movl	%ebx, (%rax,%r13)
	movq	_CH_NDMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%rax,%r13)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rax,%r13)
	movl	%ebx, %edi
	callq	_AWIN_NDMA_REG
	movq	32(%r12), %rdi
	movl	%eax, 4(%rdi,%r13)
	addq	%r13, %rdi
	movq	_AWIN_NDMA_CTL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_DMACH_WRITE
	incq	%rbx
	movl	(%r15), %eax
	addq	$40, %r13
	cmpq	%rax, %rbx
	jb	LBB0_10
LBB0_11:
	movq	_DDMA_CHANNELS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_14
## %bb.12:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %rax
	movq	%r12, 32(%rax,%rbx)
	movl	%r13d, (%rax,%rbx)
	movq	_CH_DDMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%rax,%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rax,%rbx)
	movl	%r13d, %edi
	callq	_AWIN_DDMA_REG
	movq	24(%r12), %rdi
	movl	%eax, 4(%rdi,%rbx)
	addq	%rbx, %rdi
	movq	_AWIN_DDMA_CTL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_DMACH_WRITE
	incq	%r13
	movl	(%r15), %eax
	addq	$40, %rbx
	cmpq	%rax, %r13
	jb	LBB0_13
LBB0_14:
	movq	8(%r12), %rax
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	4(%rax), %esi
	movq	_a10dmac_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rax
	addq	$16, %rax
	movq	%rax, (%rsp)
	xorl	%r15d, %r15d
	movl	%r14d, %edi
	xorl	%ecx, %ecx
	movq	%r12, %r9
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	movq	_a10dmac_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r12), %rdx
	movl	%r14d, %edi
	callq	_bus_release_resources
	movq	%r12, %rdi
	callq	_mtx_destroy
	jmp	LBB0_2
LBB0_16:
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %edi
	callq	_OF_xref_from_node
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_OF_device_register_xref
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_a10dmac_spec,4,2               ## @a10dmac_spec
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot allocate resources for device\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"a10 dmac"

	.comm	_MTX_SPIN,4,2                   ## @MTX_SPIN
L_.str.2:                               ## @.str.2
	.asciz	"cannot get clock\n"

L_.str.3:                               ## @.str.3
	.asciz	"cannot enable clock\n"

	.comm	_AWIN_DMA_IRQ_EN_REG,4,2        ## @AWIN_DMA_IRQ_EN_REG
	.comm	_AWIN_DMA_IRQ_PEND_STA_REG,4,2  ## @AWIN_DMA_IRQ_PEND_STA_REG
	.comm	_NDMA_CHANNELS,4,2              ## @NDMA_CHANNELS
	.comm	_CH_NDMA,4,2                    ## @CH_NDMA
	.comm	_AWIN_NDMA_CTL_REG,4,2          ## @AWIN_NDMA_CTL_REG
	.comm	_DDMA_CHANNELS,4,2              ## @DDMA_CHANNELS
	.comm	_CH_DDMA,4,2                    ## @CH_DDMA
	.comm	_AWIN_DDMA_CTL_REG,4,2          ## @AWIN_DDMA_CTL_REG
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_a10dmac_intr,4,2               ## @a10dmac_intr
L_.str.4:                               ## @.str.4
	.asciz	"could not setup interrupt handler\n"

	.no_dead_strip	_a10dmac_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a10dmac_attach
_a10dmac_attach:                        ; @a10dmac_attach
	.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	x19, x0
	bl	_device_get_softc
	mov	x20, x0
Lloh0:
	adrp	x22, _a10dmac_spec@GOTPAGE
Lloh1:
	ldr	x22, [x22, _a10dmac_spec@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	x2, [x0, #8]
	mov	x0, x19
	bl	_bus_alloc_resources
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_2:
Lloh4:
	adrp	x8, _ENXIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh6:
	ldr	w21, [x8]
	b	LBB0_8
LBB0_3:
Lloh7:
	adrp	x8, _MTX_SPIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MTX_SPIN@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, #0
	bl	_mtx_init
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_clk_get_by_ofw_index
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w0, [sp, #12]
	bl	_clk_enable
	cbz	w0, LBB0_9
; %bb.6:
	mov	x21, x0
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_device_printf
LBB0_8:
	mov	x0, x21
	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
LBB0_9:
Lloh16:
	adrp	x8, _AWIN_DMA_IRQ_EN_REG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AWIN_DMA_IRQ_EN_REG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_DMA_WRITE
Lloh19:
	adrp	x8, _AWIN_DMA_IRQ_PEND_STA_REG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AWIN_DMA_IRQ_PEND_STA_REG@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-1
	bl	_DMA_WRITE
Lloh22:
	adrp	x23, _NDMA_CHANNELS@GOTPAGE
Lloh23:
	ldr	x23, [x23, _NDMA_CHANNELS@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_12
; %bb.10:
	mov	x24, #0
	mov	x21, #0
Lloh24:
	adrp	x25, _CH_NDMA@GOTPAGE
Lloh25:
	ldr	x25, [x25, _CH_NDMA@GOTPAGEOFF]
Lloh26:
	adrp	x26, _AWIN_NDMA_CTL_REG@GOTPAGE
Lloh27:
	ldr	x26, [x26, _AWIN_NDMA_CTL_REG@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #32]
	add	x8, x8, x24
	str	x20, [x8, #32]
	str	w21, [x8]
	ldr	w9, [x25]
	str	w9, [x8, #24]
	stp	xzr, xzr, [x8, #8]
	mov	x0, x21
	bl	_AWIN_NDMA_REG
	ldr	x8, [x20, #32]
	add	x8, x8, x24
	str	w0, [x8, #4]
	ldr	w1, [x26]
	mov	x0, x8
	mov	w2, #0
	bl	_DMACH_WRITE
	add	x21, x21, #1
	ldr	w8, [x23]
	add	x24, x24, #40
	cmp	x21, x8
	b.lo	LBB0_11
LBB0_12:
Lloh28:
	adrp	x23, _DDMA_CHANNELS@GOTPAGE
Lloh29:
	ldr	x23, [x23, _DDMA_CHANNELS@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_15
; %bb.13:
	mov	x24, #0
	mov	x21, #0
Lloh30:
	adrp	x25, _CH_DDMA@GOTPAGE
Lloh31:
	ldr	x25, [x25, _CH_DDMA@GOTPAGEOFF]
Lloh32:
	adrp	x26, _AWIN_DDMA_CTL_REG@GOTPAGE
Lloh33:
	ldr	x26, [x26, _AWIN_DDMA_CTL_REG@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	add	x8, x8, x24
	str	x20, [x8, #32]
	str	w21, [x8]
	ldr	w9, [x25]
	str	w9, [x8, #24]
	stp	xzr, xzr, [x8, #8]
	mov	x0, x21
	bl	_AWIN_DDMA_REG
	ldr	x8, [x20, #24]
	add	x8, x8, x24
	str	w0, [x8, #4]
	ldr	w1, [x26]
	mov	x0, x8
	mov	w2, #0
	bl	_DMACH_WRITE
	add	x21, x21, #1
	ldr	w8, [x23]
	add	x24, x24, #40
	cmp	x21, x8
	b.lo	LBB0_14
LBB0_15:
	ldr	x8, [x20, #8]
	ldr	w1, [x8, #4]
Lloh34:
	adrp	x8, _INTR_MPSAFE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _INTR_MPSAFE@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _INTR_TYPE_MISC@GOTPAGE
Lloh38:
	ldr	x9, [x9, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh40:
	adrp	x8, _a10dmac_intr@GOTPAGE
Lloh41:
	ldr	x8, [x8, _a10dmac_intr@GOTPAGEOFF]
Lloh42:
	ldr	w4, [x8]
	add	x6, x20, #16
	mov	x0, x19
	mov	x3, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	w0, LBB0_17
; %bb.16:
Lloh43:
	adrp	x1, l_.str.4@PAGE
Lloh44:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	w1, [x22]
	ldr	x2, [x20, #8]
	mov	x0, x19
	bl	_bus_release_resources
	mov	x0, x20
	bl	_mtx_destroy
	b	LBB0_2
LBB0_17:
	mov	x0, x19
	bl	_ofw_bus_get_node
	bl	_OF_xref_from_node
	mov	x1, x19
	bl	_OF_device_register_xref
	mov	w21, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_a10dmac_spec,4,2               ; @a10dmac_spec
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot allocate resources for device\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"a10 dmac"

	.comm	_MTX_SPIN,4,2                   ; @MTX_SPIN
l_.str.2:                               ; @.str.2
	.asciz	"cannot get clock\n"

l_.str.3:                               ; @.str.3
	.asciz	"cannot enable clock\n"

	.comm	_AWIN_DMA_IRQ_EN_REG,4,2        ; @AWIN_DMA_IRQ_EN_REG
	.comm	_AWIN_DMA_IRQ_PEND_STA_REG,4,2  ; @AWIN_DMA_IRQ_PEND_STA_REG
	.comm	_NDMA_CHANNELS,4,2              ; @NDMA_CHANNELS
	.comm	_CH_NDMA,4,2                    ; @CH_NDMA
	.comm	_AWIN_NDMA_CTL_REG,4,2          ; @AWIN_NDMA_CTL_REG
	.comm	_DDMA_CHANNELS,4,2              ; @DDMA_CHANNELS
	.comm	_CH_DDMA,4,2                    ; @CH_DDMA
	.comm	_AWIN_DDMA_CTL_REG,4,2          ; @AWIN_DDMA_CTL_REG
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_a10dmac_intr,4,2               ; @a10dmac_intr
l_.str.4:                               ; @.str.4
	.asciz	"could not setup interrupt handler\n"

	.no_dead_strip	_a10dmac_attach
.subsections_via_symbols
