	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ich_pata_cable_detect
_ich_pata_cable_detect:                 ## @ich_pata_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	8(%rax), %edi
	callq	_to_pci_dev
	movq	8(%rbx), %rcx
	movq	(%rcx), %r8
	movq	_ich_laptop@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	(%rsi), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.1:
	movq	(%rax), %rdi
	addq	$24, %rsi
	movq	_ATA_CBL_PATA40_SHORT@GOTPCREL(%rip), %rdx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rsi), %rcx
	addq	$24, %rsi
	testq	%rcx, %rcx
	je	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdi, %rcx
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-16(%rsi), %rcx
	cmpq	8(%rax), %rcx
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-8(%rsi), %rcx
	cmpq	16(%rax), %rcx
	jne	LBB0_5
	jmp	LBB0_12
LBB0_6:
	cmpq	$0, (%rbx)
	jne	LBB0_7
## %bb.8:
	movq	_PIIX_80C_PRI@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_PIIX_80C_SEC@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%r8), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_10
## %bb.11:
	movq	_ATA_CBL_PATA40@GOTPCREL(%rip), %rdx
	jmp	LBB0_12
LBB0_10:
	movq	_ATA_CBL_PATA80@GOTPCREL(%rip), %rdx
LBB0_12:
	movl	(%rdx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ich_laptop,8,3                 ## @ich_laptop
	.comm	_ATA_CBL_PATA40_SHORT,4,2       ## @ATA_CBL_PATA40_SHORT
	.comm	_PIIX_80C_PRI,4,2               ## @PIIX_80C_PRI
	.comm	_PIIX_80C_SEC,4,2               ## @PIIX_80C_SEC
	.comm	_ATA_CBL_PATA40,4,2             ## @ATA_CBL_PATA40
	.comm	_ATA_CBL_PATA80,4,2             ## @ATA_CBL_PATA80
	.no_dead_strip	_ich_pata_cable_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ich_pata_cable_detect
_ich_pata_cable_detect:                 ; @ich_pata_cable_detect
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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	x8, [x0, #8]
	ldr	w0, [x8, #8]
	bl	_to_pci_dev
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _ich_laptop@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ich_laptop@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x12, [x9]
	cbz	x12, LBB0_6
; %bb.1:
	ldr	x10, [x0]
	add	x11, x9, #24
Lloh3:
	adrp	x9, _ATA_CBL_PATA40_SHORT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_CBL_PATA40_SHORT@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x12, [x11], #24
	cbz	x12, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x12, x10
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x12, [x11, #-16]
	ldr	x13, [x0, #8]
	cmp	x12, x13
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x12, [x11, #-8]
	ldr	x13, [x0, #16]
	cmp	x12, x13
	b.ne	LBB0_2
	b	LBB0_7
LBB0_6:
	ldr	x9, [x19]
Lloh5:
	adrp	x10, _PIIX_80C_PRI@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PIIX_80C_PRI@GOTPAGEOFF]
Lloh7:
	adrp	x11, _PIIX_80C_SEC@GOTPAGE
Lloh8:
	ldr	x11, [x11, _PIIX_80C_SEC@GOTPAGEOFF]
	cmp	x9, #0
	csel	x9, x10, x11, eq
	ldr	w9, [x9]
	ldr	w8, [x8]
Lloh9:
	adrp	x10, _ATA_CBL_PATA80@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ATA_CBL_PATA80@GOTPAGEOFF]
Lloh11:
	adrp	x11, _ATA_CBL_PATA40@GOTPAGE
Lloh12:
	ldr	x11, [x11, _ATA_CBL_PATA40@GOTPAGEOFF]
	tst	w8, w9
	csel	x9, x11, x10, eq
LBB0_7:
	ldr	w0, [x9]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ich_laptop,8,3                 ; @ich_laptop
	.comm	_ATA_CBL_PATA40_SHORT,4,2       ; @ATA_CBL_PATA40_SHORT
	.comm	_PIIX_80C_PRI,4,2               ; @PIIX_80C_PRI
	.comm	_PIIX_80C_SEC,4,2               ; @PIIX_80C_SEC
	.comm	_ATA_CBL_PATA40,4,2             ; @ATA_CBL_PATA40
	.comm	_ATA_CBL_PATA80,4,2             ; @ATA_CBL_PATA80
	.no_dead_strip	_ich_pata_cable_detect
.subsections_via_symbols
