	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_set_drive
_via_set_drive:                         ## @via_set_drive
	.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	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	callq	_ide_get_pair_dev
	movq	%rax, %r15
	movl	(%r14), %edi
	callq	_to_pci_dev
	movq	%rax, %rdi
	callq	_pci_get_drvdata
	movq	(%rax), %rcx
	movq	_via_clock@GOTPCREL(%rip), %rsi
	movl	$1000000000, %eax               ## imm = 0x3B9ACA00
	xorl	%edx, %edx
	idivl	(%rsi)
	movl	%eax, %ebx
	movq	(%rcx), %rax
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_5
## %bb.1:
	cmpl	$129, %eax
	je	LBB0_4
## %bb.2:
	movl	%ebx, %r12d
	cmpl	$130, %eax
	jne	LBB0_6
## %bb.3:
	movl	%ebx, %r12d
	shrl	%r12d
	jmp	LBB0_6
LBB0_5:
	movl	%ebx, %r12d
	shrl	$2, %r12d
	jmp	LBB0_6
LBB0_4:
	movl	%ebx, %eax
	movl	$2863311531, %r12d              ## imm = 0xAAAAAAAB
	imulq	%rax, %r12
	shrq	$33, %r12
LBB0_6:
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	callq	_ide_timing_compute
	testq	%r15, %r15
	je	LBB0_8
## %bb.7:
	movl	4(%r15), %esi
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rdx, %r15
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	callq	_ide_timing_compute
	movq	_IDE_TIMING_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rdx, %rsi
	callq	_ide_timing_merge
LBB0_8:
	movl	(%r13), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_via_set_speed
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_via_clock,4,2                  ## @via_clock
	.comm	_IDE_TIMING_8BIT,4,2            ## @IDE_TIMING_8BIT
	.no_dead_strip	_via_set_drive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_set_drive
_via_set_drive:                         ; @via_set_drive
	.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	x24, x1
	mov	x20, x0
	ldr	x19, [x0, #8]
	bl	_ide_get_pair_dev
	mov	x21, x0
	ldr	w0, [x19]
	bl	_to_pci_dev
	bl	_pci_get_drvdata
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _via_clock@GOTPAGE
Lloh1:
	ldr	x9, [x9, _via_clock@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mov	w10, #51712
	movk	w10, #15258, lsl #16
	sdiv	w22, w10, w9
	ldr	x8, [x8]
	ldr	w8, [x8]
	lsr	w9, w22, #2
	mov	w10, #43691
	movk	w10, #43690, lsl #16
	umull	x10, w22, w10
	lsr	x10, x10, #33
	lsr	w11, w22, #1
	cmp	w8, #130
	csel	w11, w22, w11, ne
	cmp	w8, #129
	csel	w10, w10, w11, eq
	cmp	w8, #128
	csel	w23, w9, w10, eq
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x24
	mov	x3, x22
	mov	x4, x23
	bl	_ide_timing_compute
	cbz	x21, LBB0_2
; %bb.1:
	ldr	w1, [x21, #4]
	mov	x2, sp
	mov	x0, x21
	mov	x3, x22
	mov	x4, x23
	bl	_ide_timing_compute
Lloh3:
	adrp	x8, _IDE_TIMING_8BIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IDE_TIMING_8BIT@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, sp
	add	x1, sp, #8
	add	x2, sp, #8
	bl	_ide_timing_merge
LBB0_2:
	ldr	w1, [x20]
	add	x2, sp, #8
	mov	x0, x19
	bl	_via_set_speed
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_via_clock,4,2                  ; @via_clock
	.comm	_IDE_TIMING_8BIT,4,2            ; @IDE_TIMING_8BIT
	.no_dead_strip	_via_set_drive
.subsections_via_symbols
