	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via82cxxx_cable_detect
_via82cxxx_cable_detect:                ## @via82cxxx_cable_detect
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_pci_get_drvdata
	movq	(%rax), %r15
	movq	%rbx, %rdi
	callq	_via_cable_override
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ATA_CBL_PATA40_SHORT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	8(%r15), %rcx
	movq	_VIA_SATA_PATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %eax
	testl	%edx, (%rcx)
	je	LBB0_5
## %bb.3:
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_ATA_CBL_SATA@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movl	(%r15), %ecx
	btl	%eax, %ecx
	jb	LBB0_6
## %bb.7:
	movq	_ATA_CBL_PATA40@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_ATA_CBL_PATA80@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_CBL_PATA40_SHORT,4,2       ## @ATA_CBL_PATA40_SHORT
	.comm	_VIA_SATA_PATA,4,2              ## @VIA_SATA_PATA
	.comm	_ATA_CBL_SATA,4,2               ## @ATA_CBL_SATA
	.comm	_ATA_CBL_PATA80,4,2             ## @ATA_CBL_PATA80
	.comm	_ATA_CBL_PATA40,4,2             ## @ATA_CBL_PATA40
	.no_dead_strip	_via82cxxx_cable_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via82cxxx_cable_detect
_via82cxxx_cable_detect:                ; @via82cxxx_cable_detect
	.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	x19, x0
	ldr	w0, [x0, #4]
	bl	_to_pci_dev
	mov	x20, x0
	bl	_pci_get_drvdata
	ldr	x21, [x0]
	mov	x0, x20
	bl	_via_cable_override
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ATA_CBL_PATA40_SHORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_CBL_PATA40_SHORT@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	ldr	x8, [x21, #8]
Lloh2:
	adrp	x9, _VIA_SATA_PATA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VIA_SATA_PATA@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh4:
	ldr	w9, [x9]
	and	w9, w9, w8
	ldr	w8, [x19]
	cmp	w9, #0
	ccmp	w8, #0, #0, ne
	b.eq	LBB0_4
; %bb.3:
	ldr	w9, [x21]
	lsr	w8, w9, w8
Lloh5:
	adrp	x9, _ATA_CBL_PATA80@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATA_CBL_PATA80@GOTPAGEOFF]
Lloh7:
	adrp	x10, _ATA_CBL_PATA40@GOTPAGE
Lloh8:
	ldr	x10, [x10, _ATA_CBL_PATA40@GOTPAGEOFF]
	tst	w8, #0x1
	csel	x8, x10, x9, eq
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _ATA_CBL_SATA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATA_CBL_SATA@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_CBL_PATA40_SHORT,4,2       ; @ATA_CBL_PATA40_SHORT
	.comm	_VIA_SATA_PATA,4,2              ; @VIA_SATA_PATA
	.comm	_ATA_CBL_SATA,4,2               ; @ATA_CBL_SATA
	.comm	_ATA_CBL_PATA80,4,2             ; @ATA_CBL_PATA80
	.comm	_ATA_CBL_PATA40,4,2             ; @ATA_CBL_PATA40
	.no_dead_strip	_via82cxxx_cable_detect
.subsections_via_symbols
