	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jmicron_cable_detect
_jmicron_cable_detect:                  ## @jmicron_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	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	4(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movl	(%rbx), %ebx
	leaq	-36(%rbp), %rdx
	movq	%rax, %rdi
	movl	$64, %esi
	callq	_pci_read_config_dword
	movl	-36(%rbp), %eax
	shrl	$22, %eax
	andl	$2, %eax
	orl	$128, %eax
	movl	$128, -32(%rbp)
	movl	%eax, -28(%rbp)
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	movl	$128, %esi
	callq	_pci_read_config_dword
	movl	-40(%rbp), %eax
	testl	$16777216, %eax                 ## imm = 0x1000000
	je	LBB0_2
## %bb.1:
	movl	$129, -32(%rbp)
LBB0_2:
	movl	-36(%rbp), %ecx
	movl	%ecx, %edx
	shrl	$22, %edx
	andl	$1, %edx
	xorl	%ebx, %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %edx
	cmpl	$129, %edx
	je	LBB0_6
## %bb.3:
	cmpl	$130, %edx
	jne	LBB0_7
## %bb.4:
	testb	$8, %cl
	je	LBB0_7
LBB0_5:
	movq	_ATA_CBL_PATA40@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	testl	$524288, %eax                   ## imm = 0x80000
	jne	LBB0_5
LBB0_7:
	movq	_ATA_CBL_PATA80@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_11
## %bb.9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_CBL_PATA40,4,2             ## @ATA_CBL_PATA40
	.comm	_ATA_CBL_PATA80,4,2             ## @ATA_CBL_PATA80
	.no_dead_strip	_jmicron_cable_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jmicron_cable_detect
_jmicron_cable_detect:                  ; @jmicron_cable_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w0, [x0, #4]
	bl	_to_pci_dev
	mov	x20, x0
	ldr	w19, [x19]
	add	x2, sp, #12
	mov	w1, #64
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	tst	w8, #0x800000
	mov	w8, #130
	mov	w9, #128
	csel	w8, w9, w8, eq
	stp	w9, w8, [sp, #16]
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #128
	bl	_pci_read_config_dword
	ldr	w8, [sp, #8]
	tbz	w8, #24, LBB0_2
; %bb.1:
	mov	w9, #129
	str	w9, [sp, #16]
LBB0_2:
	ldr	w9, [sp, #12]
	ubfx	w10, w9, #22, #1
	eor	w10, w10, w19
	add	x11, sp, #16
	ldr	w10, [x11, w10, sxtw #2]
Lloh3:
	adrp	x11, _ATA_CBL_PATA80@GOTPAGE
Lloh4:
	ldr	x11, [x11, _ATA_CBL_PATA80@GOTPAGEOFF]
Lloh5:
	adrp	x12, _ATA_CBL_PATA40@GOTPAGE
Lloh6:
	ldr	x12, [x12, _ATA_CBL_PATA40@GOTPAGEOFF]
	tst	w8, #0x80000
	csel	x8, x11, x12, eq
	tst	w9, #0x8
	csel	x9, x11, x12, eq
	cmp	w10, #130
	csel	x9, x11, x9, ne
	cmp	w10, #129
	csel	x8, x8, x9, eq
	ldr	w0, [x8]
	ldr	x8, [sp, #24]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_CBL_PATA40,4,2             ; @ATA_CBL_PATA40
	.comm	_ATA_CBL_PATA80,4,2             ; @ATA_CBL_PATA80
	.no_dead_strip	_jmicron_cable_detect
.subsections_via_symbols
