	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ali_set_piomode
_ali_set_piomode:                       ## @ali_set_piomode
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_ata_dev_pair
	movq	%rax, %r15
	movq	16(%rbx), %rsi
	leaq	-48(%rbp), %rdx
	movl	$30000, %ecx                    ## imm = 0x7530
	movq	%rbx, %rdi
	movl	$1, %r8d
	callq	_ata_timing_compute
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	movq	16(%r15), %rsi
	leaq	-56(%rbp), %r12
	movl	$30000, %ecx                    ## imm = 0x7530
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	$1, %r8d
	callq	_ata_timing_compute
	movq	_ATA_TIMING_SETUP@GOTPCREL(%rip), %rax
	movq	_ATA_TIMING_8BIT@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	orl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rdx, %rsi
	callq	_ata_timing_merge
	movq	8(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.2:
	leaq	-56(%rbp), %r12
	movl	$30000, %ecx                    ## imm = 0x7530
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	$1, %r8d
	callq	_ata_timing_compute
	movl	(%r13), %ecx
	movq	_ATA_TIMING_SETUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rdx, %rsi
	callq	_ata_timing_merge
LBB0_3:
	movq	(%rbx), %rax
	movq	_ATA_DEV_ATA@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_ali_fifo_control
LBB0_5:
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_ali_program_modes
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$5, %edx
	callq	_ali_fifo_control
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_TIMING_SETUP,4,2           ## @ATA_TIMING_SETUP
	.comm	_ATA_TIMING_8BIT,4,2            ## @ATA_TIMING_8BIT
	.comm	_ATA_DEV_ATA,8,3                ## @ATA_DEV_ATA
	.no_dead_strip	_ali_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ali_set_piomode
_ali_set_piomode:                       ; @ali_set_piomode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x20, x0
	mov	x0, x1
	bl	_ata_dev_pair
	mov	x21, x0
	ldr	x1, [x19, #16]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #30000
	mov	w4, #1
	bl	_ata_timing_compute
	cbz	x21, LBB0_3
; %bb.1:
	ldr	x1, [x21, #16]
	mov	x2, sp
	mov	x0, x21
	mov	w3, #30000
	mov	w4, #1
	bl	_ata_timing_compute
Lloh0:
	adrp	x22, _ATA_TIMING_SETUP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ATA_TIMING_SETUP@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x23, _ATA_TIMING_8BIT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ATA_TIMING_8BIT@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w3, w9, w8
	mov	x0, sp
	add	x1, sp, #8
	add	x2, sp, #8
	bl	_ata_timing_merge
	ldr	x1, [x21, #8]
	cbz	x1, LBB0_3
; %bb.2:
	mov	x2, sp
	mov	x0, x21
	mov	w3, #30000
	mov	w4, #1
	bl	_ata_timing_compute
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w3, w9, w8
	mov	x0, sp
	add	x1, sp, #8
	add	x2, sp, #8
	bl	_ata_timing_merge
LBB0_3:
	ldr	x8, [x19]
Lloh4:
	adrp	x21, _ATA_DEV_ATA@GOTPAGE
Lloh5:
	ldr	x21, [x21, _ATA_DEV_ATA@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_ali_fifo_control
LBB0_5:
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	mov	w3, #0
	bl	_ali_program_modes
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #5
	bl	_ali_fifo_control
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TIMING_SETUP,4,2           ; @ATA_TIMING_SETUP
	.comm	_ATA_TIMING_8BIT,4,2            ; @ATA_TIMING_8BIT
	.comm	_ATA_DEV_ATA,8,3                ; @ATA_DEV_ATA
	.no_dead_strip	_ali_set_piomode
.subsections_via_symbols
