	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_sata_dmainit
_fsl_sata_dmainit:                      ## @fsl_sata_dmainit
	.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, %ebx
	callq	_device_get_softc
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	_bus_get_dma_tag
	movq	_BUS_SPACE_MAXADDR_32BIT@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movq	_FSL_SATA_WORK_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	16(%r14), %rsi
	subq	$64, %rsp
	movq	%rsi, 56(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movl	%edx, 24(%rsp)
	movl	%edx, 8(%rsp)
	movl	$0, 32(%rsp)
	movl	$1, 16(%rsp)
	movq	$0, (%rsp)
	movl	%eax, %edi
	movl	$1024, %esi                     ## imm = 0x400
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	callq	_bus_dma_tag_create
	addq	$64, %rsp
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movl	16(%r14), %edi
	movq	_BUS_DMA_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	12(%r14), %rcx
	movq	%r14, %rsi
	callq	_bus_dmamem_alloc
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movl	16(%r14), %edi
	movl	(%r14), %edx
	movl	12(%r14), %esi
	movl	(%r13), %ecx
	movq	_fsl_sata_dmasetupc_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	subq	$8, %rsp
	leaq	-56(%rbp), %r9
	pushq	$0
	callq	_bus_dmamap_load
	addq	$16, %rsp
	orq	-48(%rbp), %rax
	je	LBB0_5
## %bb.3:
	movl	16(%r14), %edi
	movl	(%r14), %esi
	movl	12(%r14), %edx
	callq	_bus_dmamem_free
	jmp	LBB0_4
LBB0_5:
	movl	-56(%rbp), %eax
	movl	%eax, 8(%r14)
	movl	%ebx, %edi
	callq	_bus_get_dma_tag
	movl	(%r15), %ecx
	movl	(%r12), %r8d
	movq	_FSL_SATA_MAX_XFER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r10d
	movq	_FSL_SATA_SG_ENTRIES@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r11d
	decl	%r11d
	movq	_FSL_SATA_PRD_MAX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r15d
	leaq	20(%r14), %r13
	movq	%r14, %r12
	addq	$4, %r12
	movl	%eax, %edi
	movl	$4, %esi
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	pushq	%r12
	pushq	%r13
	movq	_busdma_lock_mutex@GOTPCREL(%rip), %rax
	pushq	(%rax)
	pushq	$0
	pushq	%r15
	pushq	%r11
	pushq	%r10
	pushq	$0
	callq	_bus_dma_tag_create
	addq	$64, %rsp
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movl	%ebx, %edi
	callq	_fsl_sata_dmafini
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ## @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
	.comm	_FSL_SATA_WORK_SIZE,4,2         ## @FSL_SATA_WORK_SIZE
	.comm	_BUS_DMA_ZERO,4,2               ## @BUS_DMA_ZERO
	.comm	_fsl_sata_dmasetupc_cb,4,2      ## @fsl_sata_dmasetupc_cb
	.comm	_FSL_SATA_MAX_XFER,4,2          ## @FSL_SATA_MAX_XFER
	.comm	_FSL_SATA_SG_ENTRIES,4,2        ## @FSL_SATA_SG_ENTRIES
	.comm	_FSL_SATA_PRD_MAX,4,2           ## @FSL_SATA_PRD_MAX
	.comm	_busdma_lock_mutex,8,3          ## @busdma_lock_mutex
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"work area: %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"WARNING - DMA initialization failed\n"

	.no_dead_strip	_fsl_sata_dmainit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsl_sata_dmainit
_fsl_sata_dmainit:                      ; @fsl_sata_dmainit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_bus_get_dma_tag
Lloh0:
	adrp	x21, _BUS_SPACE_MAXADDR_32BIT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BUS_SPACE_MAXADDR_32BIT@GOTPAGEOFF]
Lloh2:
	adrp	x22, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
	ldr	w3, [x21]
	ldr	w4, [x22]
Lloh4:
	adrp	x23, _FSL_SATA_WORK_SIZE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _FSL_SATA_WORK_SIZE@GOTPAGEOFF]
	ldr	w7, [x23]
	add	x8, x20, #16
	stp	xzr, xzr, [sp, #16]
	str	x8, [sp, #32]
	stp	w7, wzr, [sp, #4]
	mov	w8, #1
	str	w8, [sp]
	mov	w1, #1024
	mov	w2, #0
	mov	x5, #0
	mov	x6, #0
	bl	_bus_dma_tag_create
	cbnz	x0, LBB0_5
; %bb.1:
	ldr	w0, [x20, #16]
Lloh6:
	adrp	x8, _BUS_DMA_ZERO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BUS_DMA_ZERO@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x3, x20, #12
	mov	x1, x20
	bl	_bus_dmamem_alloc
	cbnz	x0, LBB0_5
; %bb.2:
	ldp	w1, w0, [x20, #12]
	ldr	w2, [x20]
	ldr	w3, [x23]
Lloh9:
	adrp	x8, _fsl_sata_dmasetupc_cb@GOTPAGE
Lloh10:
	ldr	x8, [x8, _fsl_sata_dmasetupc_cb@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	add	x5, sp, #48
	mov	w6, #0
	bl	_bus_dmamap_load
	ldr	x8, [sp, #56]
	orr	x8, x0, x8
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w1, [x20]
	ldp	w2, w0, [x20, #12]
	bl	_bus_dmamem_free
	b	LBB0_5
LBB0_4:
	ldr	w8, [sp, #48]
	str	w8, [x20, #8]
	mov	x0, x19
	bl	_bus_get_dma_tag
	ldr	w3, [x21]
	ldr	w4, [x22]
Lloh12:
	adrp	x8, _FSL_SATA_MAX_XFER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FSL_SATA_MAX_XFER@GOTPAGEOFF]
Lloh14:
	ldr	w7, [x8]
Lloh15:
	adrp	x8, _FSL_SATA_SG_ENTRIES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FSL_SATA_SG_ENTRIES@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	sub	w8, w8, #1
Lloh18:
	adrp	x9, _FSL_SATA_PRD_MAX@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FSL_SATA_PRD_MAX@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _busdma_lock_mutex@GOTPAGE
Lloh22:
	ldr	x10, [x10, _busdma_lock_mutex@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	add	x11, x20, #20
	add	x12, x20, #4
	stp	x11, x12, [sp, #24]
	str	x10, [sp, #16]
	stp	w9, wzr, [sp, #4]
	str	w8, [sp]
	mov	w1, #4
	mov	w2, #0
	mov	x5, #0
	mov	x6, #0
	bl	_bus_dma_tag_create
	cbz	x0, LBB0_7
LBB0_5:
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	mov	x0, x19
	bl	_fsl_sata_dmafini
LBB0_6:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
Lloh26:
	adrp	x8, _bootverbose@GOTPAGE
Lloh27:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.8:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_6
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ; @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
	.comm	_FSL_SATA_WORK_SIZE,4,2         ; @FSL_SATA_WORK_SIZE
	.comm	_BUS_DMA_ZERO,4,2               ; @BUS_DMA_ZERO
	.comm	_fsl_sata_dmasetupc_cb,4,2      ; @fsl_sata_dmasetupc_cb
	.comm	_FSL_SATA_MAX_XFER,4,2          ; @FSL_SATA_MAX_XFER
	.comm	_FSL_SATA_SG_ENTRIES,4,2        ; @FSL_SATA_SG_ENTRIES
	.comm	_FSL_SATA_PRD_MAX,4,2           ; @FSL_SATA_PRD_MAX
	.comm	_busdma_lock_mutex,8,3          ; @busdma_lock_mutex
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"work area: %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"WARNING - DMA initialization failed\n"

	.no_dead_strip	_fsl_sata_dmainit
.subsections_via_symbols
