	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_sata_attach
_fsl_sata_attach:                       ## @fsl_sata_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, %r15d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	$0, -48(%rbp)
	movl	%r15d, 76(%rax)
	movl	%r15d, %edi
	callq	_device_get_ivars
	movq	%rax, (%rbx)
	leaq	12(%rbx), %r14
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	leaq	8(%rbx), %r12
	movl	$0, 8(%rbx)
	movl	%r15d, %edi
	callq	_device_get_name
	movl	%eax, %r13d
	movl	%r15d, %edi
	callq	_device_get_unit
	leaq	L_.str.1(%rip), %rdx
	movl	%r13d, %edi
	movl	%eax, %esi
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rcx
	callq	_resource_int_value
	leaq	72(%rbx), %rdi
	callq	_STAILQ_INIT
	cmpl	$4, 8(%rbx)
	jl	LBB0_2
## %bb.1:
	leaq	40(%rbx), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_callout_init_mtx
LBB0_2:
	movl	%r15d, %edi
	callq	_device_get_name
	movl	%eax, %r13d
	movl	%r15d, %edi
	callq	_device_get_unit
	leaq	L_.str.2(%rip), %rdx
	leaq	-48(%rbp), %rcx
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_resource_int_value
	movq	56(%rbx), %rdi
	xorl	%eax, %eax
	movq	_FSL_SATA_MAX_SLOTS@GOTPCREL(%rip), %r12
	movq	_CTS_SATA_CAPS_H_AN@GOTPCREL(%rip), %rcx
	movq	_CTS_SATA_CAPS_H_PMREQ@GOTPCREL(%rip), %r8
	movq	_CTS_SATA_CAPS_D_PMREQ@GOTPCREL(%rip), %rsi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rsi), %edx
	orl	(%r8), %edx
	movq	56(%rbx), %rdi
	movl	%edx, 8(%rdi,%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	orl	(%rcx), %edx
	movl	%edx, 8(%rdi,%rax)
	addq	$24, %rax
	cmpq	$384, %rax                      ## imm = 0x180
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	-48(%rbp), %edx
	movl	%edx, (%rdi,%rax)
	movq	$0, 16(%rdi,%rax)
	movl	$8192, 4(%rdi,%rax)             ## imm = 0x2000
	movl	(%r12), %edx
	movl	%edx, 12(%rdi,%rax)
	movl	$0, 8(%rdi,%rax)
	movq	64(%rbx), %rdx
	movups	(%rdi,%rax), %xmm0
	movups	%xmm0, (%rdx,%rax)
	movq	$0, 16(%rdx,%rax)
	cmpl	$0, 8(%rbx)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	56(%rbx), %rdi
	movl	8(%rdi,%rax), %edx
	jmp	LBB0_6
LBB0_7:
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r15d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	_bs_le_tag@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	callq	_rman_set_bustag
	movl	%r15d, %edi
	callq	_fsl_sata_dmainit
	movl	%r15d, %edi
	callq	_fsl_sata_slotsalloc
	movl	%r15d, %edi
	callq	_fsl_sata_init
	movq	_ATA_IRQ_RID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_SHAREABLE@GOTPCREL(%rip), %rax
	movl	(%r13), %ecx
	orl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r15d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	_ATA_INTR_FLAGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_fsl_sata_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	48(%rbx), %r10
	subq	$8, %rsp
	movl	%r15d, %edi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	pushq	%r10
	callq	_bus_setup_intr
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_8:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_29
LBB0_10:
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	jmp	LBB0_23
LBB0_13:
	movq	%r14, %rdi
	callq	_mtx_lock
	movl	(%r12), %edi
	callq	_cam_simq_alloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.17:
	movq	%rax, %r13
	movq	_fsl_sataaction@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_fsl_satapoll@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_device_get_unit
	movl	(%r12), %r10d
	subq	$8, %rsp
	leaq	L_.str.6(%rip), %rdx
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rcx
	movl	%eax, %r8d
	movq	%r14, %r9
	pushq	%r13
	pushq	%r10
	pushq	$2
	callq	_cam_sim_alloc
	addq	$32, %rsp
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_18
## %bb.19:
	movq	%rax, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_xpt_bus_register
	movq	_CAM_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_20
## %bb.24:
	leaq	44(%rbx), %r13
	movq	32(%rbx), %rdi
	callq	_cam_sim_path
	movq	_CAM_TARGET_WILDCARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_CAM_LUN_WILDCARD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_xpt_create_path
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_25
## %bb.26:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	$4, %eax
	jl	LBB0_28
## %bb.27:
	movq	%rbx, %rdi
	addq	$40, %rdi
	cmpl	$4, %eax
	movq	_hz@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1000, %ecx                     ## imm = 0x3E8
	movl	$8, %esi
	cmovel	%ecx, %esi
	cltd
	idivl	%esi
	movq	_fsl_sata_pm@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %esi
	movq	%rbx, %rcx
	callq	_callout_reset
LBB0_28:
	movq	%r14, %rdi
	callq	_mtx_unlock
	xorl	%r12d, %r12d
	jmp	LBB0_29
LBB0_14:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_15
LBB0_18:
	movq	%r13, %rdi
	callq	_cam_simq_free
	leaq	L_.str.7(%rip), %rsi
LBB0_15:
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %r12d
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
LBB0_22:
	movq	%r14, %rdi
	callq	_mtx_unlock
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ATA_IRQ_RID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	24(%rbx), %rcx
	movl	%r15d, %edi
	callq	_bus_release_resource
LBB0_23:
	movl	(%r13), %esi
	movl	(%rbx), %edx
	movq	16(%rbx), %rcx
	movl	%r15d, %edi
	callq	_bus_release_resource
	movq	%r14, %rdi
	callq	_mtx_destroy
LBB0_29:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	L_.str.8(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_21
LBB0_25:
	leaq	L_.str.9(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	32(%rbx), %rdi
	callq	_cam_sim_path
	movl	%eax, %edi
	callq	_xpt_bus_deregister
LBB0_21:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movq	32(%rbx), %rdi
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cam_sim_free
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FSL SATA channel lock"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
L_.str.1:                               ## @.str.1
	.asciz	"pm_level"

L_.str.2:                               ## @.str.2
	.asciz	"sata_rev"

	.comm	_FSL_SATA_MAX_SLOTS,4,2         ## @FSL_SATA_MAX_SLOTS
	.comm	_CTS_SATA_CAPS_H_PMREQ,4,2      ## @CTS_SATA_CAPS_H_PMREQ
	.comm	_CTS_SATA_CAPS_D_PMREQ,4,2      ## @CTS_SATA_CAPS_D_PMREQ
	.comm	_CTS_SATA_CAPS_H_AN,4,2         ## @CTS_SATA_CAPS_H_AN
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_bs_le_tag,4,2                  ## @bs_le_tag
	.comm	_ATA_IRQ_RID,4,2                ## @ATA_IRQ_RID
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_RF_SHAREABLE,4,2               ## @RF_SHAREABLE
L_.str.3:                               ## @.str.3
	.asciz	"Unable to map interrupt\n"

	.comm	_ATA_INTR_FLAGS,4,2             ## @ATA_INTR_FLAGS
	.comm	_fsl_sata_intr,4,2              ## @fsl_sata_intr
L_.str.4:                               ## @.str.4
	.asciz	"Unable to setup interrupt\n"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to allocate simq\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_fsl_sataaction,4,2             ## @fsl_sataaction
	.comm	_fsl_satapoll,4,2               ## @fsl_satapoll
L_.str.6:                               ## @.str.6
	.asciz	"fslsata"

L_.str.7:                               ## @.str.7
	.asciz	"unable to allocate sim\n"

	.comm	_CAM_SUCCESS,8,3                ## @CAM_SUCCESS
L_.str.8:                               ## @.str.8
	.asciz	"unable to register xpt bus\n"

	.comm	_CAM_TARGET_WILDCARD,4,2        ## @CAM_TARGET_WILDCARD
	.comm	_CAM_LUN_WILDCARD,4,2           ## @CAM_LUN_WILDCARD
	.comm	_CAM_REQ_CMP,8,3                ## @CAM_REQ_CMP
L_.str.9:                               ## @.str.9
	.asciz	"unable to create path\n"

	.comm	_hz,4,2                         ## @hz
	.comm	_fsl_sata_pm,4,2                ## @fsl_sata_pm
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_fsl_sata_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsl_sata_attach
_fsl_sata_attach:                       ; @fsl_sata_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	bl	_device_get_softc
	mov	x20, x0
	str	wzr, [sp, #8]
	str	w21, [x0, #76]
	mov	x0, x21
	bl	_device_get_ivars
	str	x0, [x20]
	add	x19, x20, #12
Lloh0:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, #0
	bl	_mtx_init
	mov	x22, x20
	str	wzr, [x22, #8]!
	mov	x0, x21
	bl	_device_get_name
	mov	x23, x0
	mov	x0, x21
	bl	_device_get_unit
	mov	x1, x0
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x3, x22
	bl	_resource_int_value
	add	x0, x20, #72
	bl	_STAILQ_INIT
	ldr	w8, [x22]
	cmp	w8, #4
	b.lt	LBB0_2
; %bb.1:
	add	x0, x20, #40
	mov	x1, x19
	mov	w2, #0
	bl	_callout_init_mtx
LBB0_2:
	mov	x0, x21
	bl	_device_get_name
	mov	x23, x0
	mov	x0, x21
	bl	_device_get_unit
	mov	x1, x0
Lloh7:
	adrp	x2, l_.str.2@PAGE
Lloh8:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x3, sp, #8
	mov	x0, x23
	bl	_resource_int_value
	mov	x8, #0
	ldr	x13, [x20, #56]
	mov	w9, #8192
Lloh9:
	adrp	x27, _FSL_SATA_MAX_SLOTS@GOTPAGE
Lloh10:
	ldr	x27, [x27, _FSL_SATA_MAX_SLOTS@GOTPAGEOFF]
Lloh11:
	adrp	x10, _CTS_SATA_CAPS_H_AN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CTS_SATA_CAPS_H_AN@GOTPAGEOFF]
Lloh13:
	adrp	x11, _CTS_SATA_CAPS_H_PMREQ@GOTPAGE
Lloh14:
	ldr	x11, [x11, _CTS_SATA_CAPS_H_PMREQ@GOTPAGEOFF]
Lloh15:
	adrp	x12, _CTS_SATA_CAPS_D_PMREQ@GOTPAGE
Lloh16:
	ldr	x12, [x12, _CTS_SATA_CAPS_D_PMREQ@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w13, [x11]
	ldr	w14, [x12]
	orr	w14, w14, w13
	ldr	x13, [x20, #56]
	add	x15, x13, x8
	str	w14, [x15, #8]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w15, [x10]
	add	x16, x13, x8
	orr	w14, w14, w15
	str	w14, [x16, #8]
	add	x8, x8, #24
	cmp	x8, #384
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [sp, #8]
	add	x13, x13, x8
	str	xzr, [x13, #16]
	stp	w14, w9, [x13]
	ldr	w14, [x27]
	stp	wzr, w14, [x13, #8]
	ldr	x14, [x20, #64]
	add	x14, x14, x8
	ldr	q0, [x13]
	str	xzr, [x14, #16]
	str	q0, [x14]
	ldr	w13, [x20, #8]
	cbnz	w13, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x13, [x20, #56]
	add	x14, x13, x8
	ldr	w14, [x14, #8]
	b	LBB0_4
LBB0_7:
	str	wzr, [sp, #12]
Lloh17:
	adrp	x26, _SYS_RES_MEMORY@GOTPAGE
Lloh18:
	ldr	x26, [x26, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x26]
Lloh19:
	adrp	x23, _RF_ACTIVE@GOTPAGE
Lloh20:
	ldr	x23, [x23, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x2, sp, #12
	mov	x0, x21
	bl	_bus_alloc_resource_any
	str	x0, [x20, #16]
	cbz	x0, LBB0_13
; %bb.8:
Lloh21:
	adrp	x1, _bs_le_tag@GOTPAGE
Lloh22:
	ldr	x1, [x1, _bs_le_tag@GOTPAGEOFF]
	bl	_rman_set_bustag
	mov	x0, x21
	bl	_fsl_sata_dmainit
	mov	x0, x21
	bl	_fsl_sata_slotsalloc
	mov	x0, x21
	bl	_fsl_sata_init
Lloh23:
	adrp	x24, _ATA_IRQ_RID@GOTPAGE
Lloh24:
	ldr	x24, [x24, _ATA_IRQ_RID@GOTPAGEOFF]
	ldr	w8, [x24]
	str	w8, [sp, #12]
Lloh25:
	adrp	x28, _SYS_RES_IRQ@GOTPAGE
Lloh26:
	ldr	x28, [x28, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x28]
Lloh27:
	adrp	x8, _RF_SHAREABLE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RF_SHAREABLE@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x23]
	orr	w3, w9, w8
	add	x2, sp, #12
	mov	x0, x21
	bl	_bus_alloc_resource_any
	str	x0, [x20, #24]
	cbz	x0, LBB0_14
; %bb.9:
	mov	x1, x0
Lloh30:
	adrp	x8, _ATA_INTR_FLAGS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ATA_INTR_FLAGS@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
Lloh33:
	adrp	x8, _fsl_sata_intr@GOTPAGE
Lloh34:
	ldr	x8, [x8, _fsl_sata_intr@GOTPAGEOFF]
Lloh35:
	ldr	w4, [x8]
	add	x6, x20, #48
	mov	x0, x21
	mov	x3, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	x0, LBB0_17
; %bb.10:
Lloh36:
	adrp	x1, l_.str.4@PAGE
Lloh37:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_device_printf
Lloh38:
	adrp	x8, _ENXIO@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_11:
	ldr	w22, [x8]
LBB0_12:
	mov	x0, x19
	bl	_mtx_unlock
	ldr	w1, [x28]
	ldr	w2, [x24]
	ldr	x3, [x20, #24]
	mov	x0, x21
	bl	_bus_release_resource
	b	LBB0_15
LBB0_13:
Lloh40:
	adrp	x8, _ENXIO@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh42:
	ldr	w22, [x8]
	b	LBB0_16
LBB0_14:
Lloh43:
	adrp	x1, l_.str.3@PAGE
Lloh44:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_device_printf
Lloh45:
	adrp	x8, _ENXIO@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh47:
	ldr	w22, [x8]
LBB0_15:
	ldr	w1, [x26]
	ldr	w2, [x20]
	ldr	x3, [x20, #16]
	mov	x0, x21
	bl	_bus_release_resource
	mov	x0, x19
	bl	_mtx_destroy
LBB0_16:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_17:
	mov	x0, x19
	bl	_mtx_lock
	ldr	w0, [x27]
	bl	_cam_simq_alloc
	cbz	x0, LBB0_24
; %bb.18:
	mov	x23, x0
Lloh48:
	adrp	x8, _fsl_sataaction@GOTPAGE
Lloh49:
	ldr	x8, [x8, _fsl_sataaction@GOTPAGEOFF]
Lloh50:
	ldr	w24, [x8]
Lloh51:
	adrp	x8, _fsl_satapoll@GOTPAGE
Lloh52:
	ldr	x8, [x8, _fsl_satapoll@GOTPAGEOFF]
Lloh53:
	ldr	w25, [x8]
	mov	x0, x21
	bl	_device_get_unit
	mov	x4, x0
	ldr	w7, [x27]
	str	x23, [sp]
Lloh54:
	adrp	x2, l_.str.6@PAGE
Lloh55:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x24
	mov	x1, x25
	mov	x3, x20
	mov	x5, x19
	mov	w6, #2
	bl	_cam_sim_alloc
	str	x0, [x20, #32]
	cbz	x0, LBB0_25
; %bb.19:
	mov	x1, x21
	mov	w2, #0
	bl	_xpt_bus_register
Lloh56:
	adrp	x8, _CAM_SUCCESS@GOTPAGE
Lloh57:
	ldr	x8, [x8, _CAM_SUCCESS@GOTPAGEOFF]
Lloh58:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_26
; %bb.20:
	add	x23, x20, #44
	ldr	x0, [x20, #32]
	bl	_cam_sim_path
	mov	x2, x0
Lloh59:
	adrp	x8, _CAM_TARGET_WILDCARD@GOTPAGE
Lloh60:
	ldr	x8, [x8, _CAM_TARGET_WILDCARD@GOTPAGEOFF]
Lloh61:
	ldr	w3, [x8]
Lloh62:
	adrp	x8, _CAM_LUN_WILDCARD@GOTPAGE
Lloh63:
	ldr	x8, [x8, _CAM_LUN_WILDCARD@GOTPAGEOFF]
Lloh64:
	ldr	w4, [x8]
	mov	x0, x23
	mov	x1, #0
	bl	_xpt_create_path
Lloh65:
	adrp	x8, _CAM_REQ_CMP@GOTPAGE
Lloh66:
	ldr	x8, [x8, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh67:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_27
; %bb.21:
	ldr	w8, [x22]
	cmp	w8, #4
	b.lt	LBB0_23
; %bb.22:
	add	x0, x20, #40
Lloh68:
	adrp	x9, _hz@GOTPAGE
Lloh69:
	ldr	x9, [x9, _hz@GOTPAGEOFF]
Lloh70:
	ldr	w9, [x9]
	mov	w10, #8
	mov	w11, #1000
	cmp	w8, #4
	csel	w8, w11, w10, eq
	sdiv	w1, w9, w8
Lloh71:
	adrp	x8, _fsl_sata_pm@GOTPAGE
Lloh72:
	ldr	x8, [x8, _fsl_sata_pm@GOTPAGEOFF]
Lloh73:
	ldr	w2, [x8]
	mov	x3, x20
	bl	_callout_reset
LBB0_23:
	mov	x0, x19
	bl	_mtx_unlock
	mov	w22, #0
	b	LBB0_16
LBB0_24:
Lloh74:
	adrp	x1, l_.str.5@PAGE
Lloh75:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_device_printf
Lloh76:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh77:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_25:
	mov	x0, x23
	bl	_cam_simq_free
Lloh78:
	adrp	x1, l_.str.7@PAGE
Lloh79:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x21
	bl	_device_printf
Lloh80:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh81:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh82:
	ldr	w22, [x8]
Lloh83:
	adrp	x24, _ATA_IRQ_RID@GOTPAGE
Lloh84:
	ldr	x24, [x24, _ATA_IRQ_RID@GOTPAGEOFF]
	b	LBB0_12
LBB0_26:
Lloh85:
	adrp	x1, l_.str.8@PAGE
Lloh86:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x21
	bl	_device_printf
Lloh87:
	adrp	x8, _ENXIO@GOTPAGE
Lloh88:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh89:
	ldr	w22, [x8]
	b	LBB0_28
LBB0_27:
Lloh90:
	adrp	x1, l_.str.9@PAGE
Lloh91:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x21
	bl	_device_printf
Lloh92:
	adrp	x8, _ENXIO@GOTPAGE
Lloh93:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh94:
	ldr	w22, [x8]
	ldr	x0, [x20, #32]
	bl	_cam_sim_path
	bl	_xpt_bus_deregister
LBB0_28:
Lloh95:
	adrp	x24, _ATA_IRQ_RID@GOTPAGE
Lloh96:
	ldr	x24, [x24, _ATA_IRQ_RID@GOTPAGEOFF]
	ldr	x0, [x20, #32]
Lloh97:
	adrp	x8, _TRUE@GOTPAGE
Lloh98:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh99:
	ldr	w1, [x8]
	bl	_cam_sim_free
	b	LBB0_12
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGot	Lloh76, Lloh77
	.loh AdrpAdd	Lloh74, Lloh75
	.loh AdrpLdrGot	Lloh83, Lloh84
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpAdd	Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpAdd	Lloh85, Lloh86
	.loh AdrpLdrGotLdr	Lloh92, Lloh93, Lloh94
	.loh AdrpAdd	Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh97, Lloh98, Lloh99
	.loh AdrpLdrGot	Lloh95, Lloh96
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FSL SATA channel lock"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
l_.str.1:                               ; @.str.1
	.asciz	"pm_level"

l_.str.2:                               ; @.str.2
	.asciz	"sata_rev"

	.comm	_FSL_SATA_MAX_SLOTS,4,2         ; @FSL_SATA_MAX_SLOTS
	.comm	_CTS_SATA_CAPS_H_PMREQ,4,2      ; @CTS_SATA_CAPS_H_PMREQ
	.comm	_CTS_SATA_CAPS_D_PMREQ,4,2      ; @CTS_SATA_CAPS_D_PMREQ
	.comm	_CTS_SATA_CAPS_H_AN,4,2         ; @CTS_SATA_CAPS_H_AN
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_bs_le_tag,4,2                  ; @bs_le_tag
	.comm	_ATA_IRQ_RID,4,2                ; @ATA_IRQ_RID
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_RF_SHAREABLE,4,2               ; @RF_SHAREABLE
l_.str.3:                               ; @.str.3
	.asciz	"Unable to map interrupt\n"

	.comm	_ATA_INTR_FLAGS,4,2             ; @ATA_INTR_FLAGS
	.comm	_fsl_sata_intr,4,2              ; @fsl_sata_intr
l_.str.4:                               ; @.str.4
	.asciz	"Unable to setup interrupt\n"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to allocate simq\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_fsl_sataaction,4,2             ; @fsl_sataaction
	.comm	_fsl_satapoll,4,2               ; @fsl_satapoll
l_.str.6:                               ; @.str.6
	.asciz	"fslsata"

l_.str.7:                               ; @.str.7
	.asciz	"unable to allocate sim\n"

	.comm	_CAM_SUCCESS,8,3                ; @CAM_SUCCESS
l_.str.8:                               ; @.str.8
	.asciz	"unable to register xpt bus\n"

	.comm	_CAM_TARGET_WILDCARD,4,2        ; @CAM_TARGET_WILDCARD
	.comm	_CAM_LUN_WILDCARD,4,2           ; @CAM_LUN_WILDCARD
	.comm	_CAM_REQ_CMP,8,3                ; @CAM_REQ_CMP
l_.str.9:                               ; @.str.9
	.asciz	"unable to create path\n"

	.comm	_hz,4,2                         ; @hz
	.comm	_fsl_sata_pm,4,2                ; @fsl_sata_pm
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_fsl_sata_attach
.subsections_via_symbols
