	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sis_cable_detect
_sis_cable_detect:                      ## @sis_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_to_pci_dev
	movq	_sis_laptop@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	(%rdx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	(%rax), %rsi
	addq	$24, %rdx
	movq	_ATA_CBL_PATA40_SHORT@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rdx), %rdi
	addq	$24, %rdx
	testq	%rdi, %rdi
	je	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, %rdi
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-16(%rdx), %rdi
	cmpq	8(%rax), %rdi
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-8(%rdx), %rdi
	cmpq	16(%rax), %rdi
	jne	LBB0_5
	jmp	LBB0_13
LBB0_6:
	movq	_chipset_family@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_ATA_133@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jge	LBB0_7
## %bb.8:
	movq	_ATA_66@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jl	LBB0_12
## %bb.9:
	movl	$0, -20(%rbp)
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	setne	%bl
	shll	$4, %ebx
	addl	$16, %ebx
	leaq	-20(%rbp), %rdx
	movq	%rax, %rdi
	movl	$72, %esi
	callq	_pci_read_config_byte
	xorl	%eax, %eax
	andl	-20(%rbp), %ebx
	jmp	LBB0_10
LBB0_7:
	movl	$0, -24(%rbp)
	xorl	%ecx, %ecx
	cmpq	$0, (%r14)
	setne	%cl
	leal	(%rcx,%rcx), %esi
	addl	$80, %esi
	leaq	-24(%rbp), %rdx
	movq	%rax, %rdi
	callq	_pci_read_config_word
	xorl	%eax, %eax
	testl	$32768, -24(%rbp)               ## imm = 0x8000
LBB0_10:
	sete	%al
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movq	_ATA_CBL_PATA80@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_12:
	movq	_ATA_CBL_PATA40@GOTPCREL(%rip), %rcx
LBB0_13:
	movl	(%rcx), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sis_laptop,8,3                 ## @sis_laptop
	.comm	_ATA_CBL_PATA40_SHORT,4,2       ## @ATA_CBL_PATA40_SHORT
	.comm	_chipset_family,8,3             ## @chipset_family
	.comm	_ATA_133,8,3                    ## @ATA_133
	.comm	_ATA_66,8,3                     ## @ATA_66
	.comm	_ATA_CBL_PATA80,4,2             ## @ATA_CBL_PATA80
	.comm	_ATA_CBL_PATA40,4,2             ## @ATA_CBL_PATA40
	.no_dead_strip	_sis_cable_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sis_cable_detect
_sis_cable_detect:                      ; @sis_cable_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_to_pci_dev
Lloh0:
	adrp	x8, _sis_laptop@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sis_laptop@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x11, [x8]
	cbz	x11, LBB0_6
; %bb.1:
	ldr	x9, [x0]
	add	x10, x8, #24
Lloh3:
	adrp	x8, _ATA_CBL_PATA40_SHORT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_CBL_PATA40_SHORT@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x11, [x10], #24
	cbz	x11, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x11, x9
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x11, [x10, #-16]
	ldr	x12, [x0, #8]
	cmp	x11, x12
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x11, [x10, #-8]
	ldr	x12, [x0, #16]
	cmp	x11, x12
	b.ne	LBB0_2
	b	LBB0_12
LBB0_6:
Lloh5:
	adrp	x8, _chipset_family@GOTPAGE
Lloh6:
	ldr	x8, [x8, _chipset_family@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _ATA_133@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ATA_133@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.7:
Lloh11:
	adrp	x9, _ATA_66@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_66@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_9
; %bb.8:
	str	wzr, [sp, #8]
	ldr	x8, [x19]
	cmp	x8, #0
	mov	w8, #32
	mov	w9, #16
	csel	w19, w9, w8, eq
	add	x2, sp, #8
	mov	w1, #72
	bl	_pci_read_config_byte
	ldr	w8, [sp, #8]
	tst	w8, w19
	cset	w8, eq
	cbnz	w8, LBB0_11
LBB0_9:
Lloh14:
	adrp	x8, _ATA_CBL_PATA40@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ATA_CBL_PATA40@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	str	wzr, [sp, #12]
	ldr	x8, [x19]
	cmp	x8, #0
	mov	w8, #82
	mov	w9, #80
	csel	w1, w9, w8, eq
	add	x2, sp, #12
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
	mov	w9, #1
	bic	w8, w9, w8, lsr #15
	cbz	w8, LBB0_9
LBB0_11:
Lloh16:
	adrp	x8, _ATA_CBL_PATA80@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ATA_CBL_PATA80@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_sis_laptop,8,3                 ; @sis_laptop
	.comm	_ATA_CBL_PATA40_SHORT,4,2       ; @ATA_CBL_PATA40_SHORT
	.comm	_chipset_family,8,3             ; @chipset_family
	.comm	_ATA_133,8,3                    ; @ATA_133
	.comm	_ATA_66,8,3                     ; @ATA_66
	.comm	_ATA_CBL_PATA80,4,2             ; @ATA_CBL_PATA80
	.comm	_ATA_CBL_PATA40,4,2             ; @ATA_CBL_PATA40
	.no_dead_strip	_sis_cable_detect
.subsections_via_symbols
