	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_host_register              ## -- Begin function ata_host_register
	.p2align	4, 0x90
_ata_host_register:                     ## @ata_host_register
	.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
	movq	%rdi, %r12
	movq	_ATA_HOST_STARTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r14
	movl	4(%r12), %eax
	movq	8(%r12), %rdx
	movslq	%eax, %rcx
	movq	(%rdx,%rcx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.4:
	leaq	8(,%rcx,8), %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	callq	_kfree
	movq	8(%r12), %rax
	movq	(%rax,%rbx), %rdi
	addq	$8, %rbx
	testq	%rdi, %rdi
	jne	LBB0_5
## %bb.6:
	movl	4(%r12), %eax
LBB0_7:
	testl	%eax, %eax
	jle	LBB0_10
## %bb.8:
	xorl	%ebx, %ebx
	movq	_ata_print_id@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_atomic_inc_return
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movl	%eax, 40(%rcx)
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_9
LBB0_10:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ata_scsi_add_hosts
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.11:
	movq	%r12, %rdi
	callq	_ata_acpi_associate
	cmpl	$0, 4(%r12)
	jle	LBB0_12
## %bb.16:
	movq	_ATA_CBL_NONE@GOTPCREL(%rip), %r13
	xorl	%r15d, %r15d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%eax, %eax
	callq	_ata_port_printk
LBB0_25:                                ##   in Loop: Header=BB0_17 Depth=1
	incq	%r15
	movslq	4(%r12), %rax
	cmpq	%rax, %r15
	jge	LBB0_13
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%r15,8), %rbx
	movq	(%rbx), %rax
	cmpq	(%r13), %rax
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	_ATA_FLAG_SATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	_ATA_CBL_SATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=1
	leaq	12(%rbx), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_sata_link_init_spd
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	callq	_sata_link_init_spd
LBB0_22:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	24(%rbx), %edi
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	callq	_ata_pack_xfermask
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_ata_port_is_dummy
	movq	_KERN_INFO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	_ATA_FLAG_SATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	8(%rbx), %eax
	setne	%cl
	leal	(%rcx,%rcx,2), %r13d
	orl	$80, %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ata_mode_string
	movl	12(%rbx), %r9d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%r13d, %ecx
	movq	_ATA_CBL_NONE@GOTPCREL(%rip), %r13
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_ata_port_printk
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_ata_ehi_clear_desc
	jmp	LBB0_25
LBB0_1:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r12), %esi
	leaq	L_.str(%rip), %rdx
	callq	_dev_printk
	movl	$1, %edi
	callq	_WARN_ON
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_2
LBB0_13:
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	LBB0_2
## %bb.14:
	movq	_async_port_probe@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rsi
	movl	(%r14), %edi
	callq	_async_schedule
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_15
	jmp	LBB0_2
LBB0_12:
	xorl	%r15d, %r15d
LBB0_2:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_HOST_STARTED,4,2           ## @ATA_HOST_STARTED
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BUG: trying to register unstarted host\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ata_print_id,4,2               ## @ata_print_id
	.comm	_ATA_CBL_NONE,8,3               ## @ATA_CBL_NONE
	.comm	_ATA_FLAG_SATA,4,2              ## @ATA_FLAG_SATA
	.comm	_ATA_CBL_SATA,8,3               ## @ATA_CBL_SATA
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
L_.str.1:                               ## @.str.1
	.asciz	"%cATA max %s %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"DUMMY\n"

	.comm	_async_port_probe,4,2           ## @async_port_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_host_register              ; -- Begin function ata_host_register
	.p2align	2
_ata_host_register:                     ; @ata_host_register
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _ATA_HOST_STARTED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_HOST_STARTED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.1:
	mov	x20, x1
	ldr	w8, [x19, #4]
	ldr	x9, [x19, #8]
	ldr	x0, [x9, w8, sxtw #3]
	cbz	x0, LBB0_5
; %bb.2:
	sxtw	x8, w8
	lsl	x8, x8, #3
	add	x21, x8, #8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_kfree
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x21]
	add	x21, x21, #8
	cbnz	x0, LBB0_3
; %bb.4:
	ldr	w8, [x19, #4]
LBB0_5:
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x22, #0
Lloh3:
	adrp	x21, _ata_print_id@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ata_print_id@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_atomic_inc_return
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x22, lsl #3]
	str	w0, [x8, #40]
	add	x22, x22, #1
	ldrsw	x8, [x19, #4]
	cmp	x22, x8
	b.lt	LBB0_7
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_ata_scsi_add_hosts
	cbnz	w0, LBB0_25
; %bb.9:
	mov	x0, x19
	bl	_ata_acpi_associate
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.10:
	mov	x26, #0
Lloh5:
	adrp	x21, _ATA_CBL_NONE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ATA_CBL_NONE@GOTPAGEOFF]
Lloh7:
	adrp	x28, _ATA_FLAG_SATA@GOTPAGE
Lloh8:
	ldr	x28, [x28, _ATA_FLAG_SATA@GOTPAGEOFF]
Lloh9:
	adrp	x20, _KERN_INFO@GOTPAGE
Lloh10:
	ldr	x20, [x20, _KERN_INFO@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	x1, x24
Lloh11:
	adrp	x2, l_.str.2@PAGE
Lloh12:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_ata_port_printk
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x19, #4]
	cmp	x26, x8
	b.ge	LBB0_21
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x22, [x8, x26, lsl #3]
	ldr	x8, [x22]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x22, #8]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh13:
	adrp	x8, _ATA_CBL_SATA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ATA_CBL_SATA@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	str	x8, [x22]
LBB0_16:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x23, x22, #12
	mov	x0, x23
	bl	_sata_link_init_spd
	ldr	x0, [x22, #32]
	cbz	x0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=1
	bl	_sata_link_init_spd
LBB0_18:                                ;   in Loop: Header=BB0_13 Depth=1
	ldp	w1, w0, [x22, #20]
	ldr	w2, [x22, #16]
	bl	_ata_pack_xfermask
	mov	x25, x0
	mov	x0, x22
	bl	_ata_port_is_dummy
	ldr	w24, [x20]
	cbnz	w0, LBB0_11
; %bb.19:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x20, x21
	ldr	w21, [x22, #8]
	ldr	w27, [x28]
	mov	x0, x25
	bl	_ata_mode_string
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x22, #12]
	str	x8, [sp, #16]
	tst	w27, w21
	mov	x21, x20
Lloh16:
	adrp	x20, _KERN_INFO@GOTPAGE
Lloh17:
	ldr	x20, [x20, _KERN_INFO@GOTPAGEOFF]
	mov	w8, #83
	mov	w9, #80
	csel	x8, x9, x8, eq
	stp	x8, x0, [sp]
	mov	x0, x22
	mov	x1, x24
Lloh18:
	adrp	x2, l_.str.1@PAGE
Lloh19:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_ata_port_printk
	mov	x0, x23
	bl	_ata_ehi_clear_desc
	b	LBB0_12
LBB0_20:
Lloh20:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	ldr	w1, [x19, #16]
Lloh23:
	adrp	x2, l_.str@PAGE
Lloh24:
	add	x2, x2, l_.str@PAGEOFF
	bl	_dev_printk
	mov	w0, #1
	bl	_WARN_ON
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_25
LBB0_21:
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.22:
	mov	x20, #0
Lloh28:
	adrp	x21, _async_port_probe@GOTPAGE
Lloh29:
	ldr	x21, [x21, _async_port_probe@GOTPAGEOFF]
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x1, [x8, x20, lsl #3]
	ldr	w0, [x21]
	bl	_async_schedule
	add	x20, x20, #1
	ldrsw	x8, [x19, #4]
	cmp	x20, x8
	b.lt	LBB0_23
LBB0_24:
	mov	w0, #0
LBB0_25:
	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
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_HOST_STARTED,4,2           ; @ATA_HOST_STARTED
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BUG: trying to register unstarted host\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ata_print_id,4,2               ; @ata_print_id
	.comm	_ATA_CBL_NONE,8,3               ; @ATA_CBL_NONE
	.comm	_ATA_FLAG_SATA,4,2              ; @ATA_FLAG_SATA
	.comm	_ATA_CBL_SATA,8,3               ; @ATA_CBL_SATA
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
l_.str.1:                               ; @.str.1
	.asciz	"%cATA max %s %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"DUMMY\n"

	.comm	_async_port_probe,4,2           ; @async_port_probe
.subsections_via_symbols
