	.file	"extr_piix.c_piix_cable_detect.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	piix_cable_detect, @function
piix_cable_detect:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	to_pci_dev@PLT
	mov	rdx, QWORD PTR ich_laptop[rip]
	cmp	QWORD PTR [rbx], 1
	mov	DWORD PTR 4[rsp], 0
	sbb	ebx, ebx
	mov	rdi, rax
	mov	rcx, QWORD PTR [rdx]
	and	bl, 112
	add	ebx, 192
	test	rcx, rcx
	je	.L3
	mov	rsi, QWORD PTR [rax]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rcx, QWORD PTR 24[rdx]
	add	rdx, 24
	test	rcx, rcx
	je	.L3
.L6:
	cmp	rsi, rcx
	jne	.L4
	mov	rax, QWORD PTR 8[rdi]
	cmp	QWORD PTR 8[rdx], rax
	jne	.L4
	mov	rax, QWORD PTR 16[rdi]
	cmp	QWORD PTR 16[rdx], rax
	jne	.L4
	mov	eax, DWORD PTR ATA_CBL_PATA40_SHORT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	lea	rdx, 4[rsp]
	mov	esi, 84
	call	pci_read_config_byte@PLT
	mov	eax, DWORD PTR ATA_CBL_PATA80[rip]
	test	DWORD PTR 4[rsp], ebx
	cmove	eax, DWORD PTR ATA_CBL_PATA40[rip]
.L1:
	mov	rbx, QWORD PTR 8[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L16
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	piix_cable_detect, .-piix_cable_detect
	.comm	ich_laptop,8,8
	.comm	ATA_CBL_PATA80,4,4
	.comm	ATA_CBL_PATA40_SHORT,4,4
	.comm	ATA_CBL_PATA40,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_piix.c_piix_cable_detect.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	piix_cable_detect, %function
piix_cable_detect:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	ldr	r3, .L17
	mov	r4, r0
	sub	sp, sp, #8
	ldr	r0, [r0, #4]
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	to_pci_dev
	mov	r1, #0
	ldr	r2, .L17+4
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r1
	ldr	r3, [r2]
	movne	r4, #192
	moveq	r4, #48
	cmp	r3, r1
	str	r1, [sp]
	beq	.L3
	ldr	r1, [r0]
	b	.L6
.L4:
	ldr	r3, [r2, #12]!
	cmp	r3, #0
	beq	.L3
.L6:
	cmp	r1, r3
	bne	.L4
	ldr	ip, [r2, #4]
	ldr	r3, [r0, #4]
	cmp	ip, r3
	bne	.L4
	ldr	ip, [r2, #8]
	ldr	r3, [r0, #8]
	cmp	ip, r3
	bne	.L4
	ldr	r3, .L17+8
	ldr	r0, [r3]
	b	.L1
.L3:
	mov	r2, sp
	mov	r1, #84
	bl	pci_read_config_byte
	ldr	r3, [sp]
	tst	r4, r3
	ldrne	r3, .L17+12
	ldreq	r3, .L17+16
	ldr	r0, [r3]
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	add	sp, sp, #8
	@ sp needed
	pop	{r4, pc}
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	ich_laptop
	.word	ATA_CBL_PATA40_SHORT
	.word	ATA_CBL_PATA80
	.word	ATA_CBL_PATA40
	.size	piix_cable_detect, .-piix_cable_detect
	.comm	ich_laptop,4,4
	.comm	ATA_CBL_PATA80,4,4
	.comm	ATA_CBL_PATA40_SHORT,4,4
	.comm	ATA_CBL_PATA40,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
