	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qdi6500_set_piomode
_qdi6500_set_piomode:                   ## @qdi6500_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movl	8(%rsi), %esi
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	movl	$30303, %ecx                    ## imm = 0x765F
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_ata_timing_compute
	cmpq	$0, 16(%r15)
	movl	-36(%rbp), %edi
	je	LBB0_2
## %bb.1:
	movl	$8, %r12d
	movl	$1, %esi
	movl	$8, %edx
	callq	_clamp_val
	subl	%eax, %r12d
	movl	-40(%rbp), %edi
	movl	$18, %ebx
	movl	$3, %esi
	movl	$18, %edx
	jmp	LBB0_3
LBB0_2:
	movl	$9, %r12d
	movl	$2, %esi
	movl	$9, %edx
	callq	_clamp_val
	subl	%eax, %r12d
	movl	-40(%rbp), %edi
	movl	$15, %ebx
	xorl	%esi, %esi
	movl	$15, %edx
LBB0_3:
	callq	_clamp_val
	subl	%eax, %ebx
	shll	$4, %ebx
	orl	%r12d, %ebx
	orl	$8, %ebx
	movq	(%r15), %rax
	movq	(%r14), %rcx
	movl	%ebx, (%rax,%rcx,4)
	movl	8(%r15), %esi
	movl	%ebx, %edi
	callq	_outb
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_qdi6500_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qdi6500_set_piomode
_qdi6500_set_piomode:                   ; @qdi6500_set_piomode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
	ldr	x8, [x0]
	ldr	x20, [x8]
	ldr	w1, [x1, #8]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #30303
	mov	w4, #1000
	bl	_ata_timing_compute
	ldr	x8, [x20, #16]
	ldr	w0, [sp, #12]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w21, #8
	mov	w1, #1
	mov	w2, #8
	bl	_clamp_val
	sub	w21, w21, w0
	ldr	w0, [sp, #8]
	mov	w22, #18
	mov	w1, #3
	mov	w2, #18
	b	LBB0_3
LBB0_2:
	mov	w21, #9
	mov	w1, #2
	mov	w2, #9
	bl	_clamp_val
	sub	w21, w21, w0
	ldr	w0, [sp, #8]
	mov	w22, #15
	mov	w1, #0
	mov	w2, #15
LBB0_3:
	bl	_clamp_val
	sub	w8, w22, w0
	orr	w8, w21, w8, lsl #4
	orr	w0, w8, #0x8
	ldr	x8, [x20]
	ldr	x9, [x19]
	str	w0, [x8, x9, lsl #2]
	ldr	w1, [x20, #8]
	bl	_outb
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_qdi6500_set_piomode
.subsections_via_symbols
