	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_dev_select                 ## -- Begin function ata_dev_select
	.p2align	4, 0x90
_ata_dev_select:                        ## @ata_dev_select
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r12d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_ata_msg_probe
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	callq	_ata_port_printk
LBB0_2:
	testl	%r12d, %r12d
	je	LBB0_7
## %bb.3:
	movq	%rbx, %rdi
	callq	_ata_wait_idle
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.4:
	movq	(%rbx), %rax
	movl	%r14d, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	_ATA_DEV_ATAPI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movl	$150, %esi
	callq	_ata_msleep
LBB0_6:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ata_wait_idle                  ## TAILCALL
LBB0_7:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ata_dev_select: ENTER, device %u, wait %u\n"

	.comm	_ATA_DEV_ATAPI,8,3              ## @ATA_DEV_ATAPI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_dev_select                 ; -- Begin function ata_dev_select
	.p2align	2
_ata_dev_select:                        ; @ata_dev_select
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	bl	_ata_msg_probe
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _KERN_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KERN_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	mov	x4, x22
	bl	_ata_port_printk
LBB0_2:
	cbz	w22, LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_ata_wait_idle
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	cbz	w21, LBB0_6
; %bb.4:
	ldr	x8, [x19]
	ldr	x8, [x8, w20, uxtw #3]
Lloh5:
	adrp	x9, _ATA_DEV_ATAPI@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATA_DEV_ATAPI@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #150
	bl	_ata_msleep
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ata_wait_idle
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	x2, [x8]
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	br	x2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ata_dev_select: ENTER, device %u, wait %u\n"

	.comm	_ATA_DEV_ATAPI,8,3              ; @ATA_DEV_ATAPI
.subsections_via_symbols
