	.file	"extr_libata-core.c_sata_link_resume.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"link resume succeeded after %d retries\n"
	.align 8
.LC1:
	.string	"failed to resume link (SControl %X)\n"
	.text
	.p2align 4
	.globl	sata_link_resume
	.type	sata_link_resume, @function
sata_link_resume:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR SCR_CONTROL[rip]
	mov	ebx, DWORD PTR ATA_LINK_RESUME_TRIES[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rbp, rsp
	mov	rdx, rbp
	call	sata_scr_read@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	edx, DWORD PTR [rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	esi, DWORD PTR SCR_CONTROL[rip]
	mov	rdx, rbp
	mov	rdi, r15
	call	sata_scr_read@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	edx, DWORD PTR [rsp]
	mov	eax, edx
	and	eax, 3855
	cmp	eax, 768
	je	.L4
	sub	ebx, 1
	je	.L16
.L5:
	mov	esi, DWORD PTR SCR_CONTROL[rip]
	and	edx, 240
	mov	rdi, r15
	or	dh, 3
	mov	DWORD PTR [rsp], edx
	call	sata_scr_write@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	eax, DWORD PTR [r15]
	test	DWORD PTR ATA_LFLAG_NO_DB_DELAY[rip], eax
	jne	.L3
	mov	edi, DWORD PTR 4[r15]
	mov	esi, 200
	call	ata_msleep@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edx, DWORD PTR ATA_LINK_RESUME_TRIES[rip]
	cmp	edx, ebx
	jle	.L9
	sub	edx, ebx
	lea	rsi, .LC0[rip]
	mov	rdi, r15
	call	ata_link_warn@PLT
.L9:
	mov	rdx, r14
	mov	rsi, r13
	mov	rdi, r15
	call	sata_link_debounce@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	esi, DWORD PTR SCR_ERROR[rip]
	lea	rdx, 4[rsp]
	mov	rdi, r15
	call	sata_scr_read@PLT
	test	eax, eax
	je	.L17
.L7:
	mov	ecx, eax
	add	ecx, DWORD PTR EINVAL[rip]
	cmovne	r12d, eax
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
	mov	rdi, r15
	call	ata_link_warn@PLT
	jmp	.L1
.L17:
	mov	edx, DWORD PTR 4[rsp]
	mov	esi, DWORD PTR SCR_ERROR[rip]
	mov	rdi, r15
	call	sata_scr_write@PLT
	jmp	.L7
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sata_link_resume, .-sata_link_resume
	.comm	SCR_ERROR,4,4
	.comm	SCR_CONTROL,4,4
	.comm	EINVAL,4,4
	.comm	ATA_LINK_RESUME_TRIES,4,4
	.comm	ATA_LFLAG_NO_DB_DELAY,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_libata-core.c_sata_link_resume.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"link resume succeeded after %d retries\012\000"
	.align	2
.LC1:
	.ascii	"failed to resume link (SControl %X)\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sata_link_resume
	.syntax unified
	.arm
	.fpu softvfp
	.type	sata_link_resume, %function
sata_link_resume:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r9, r1
	ldr	r6, .L19
	sub	sp, sp, #28
	ldr	r3, .L19+4
	ldr	fp, .L19+8
	str	r9, [sp, #4]
	mov	r10, r2
	ldr	r1, [r6]
	add	r2, sp, #12
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r9, r0
	ldr	r5, [fp]
	bl	sata_scr_read
	subs	r4, r0, #0
	bne	.L1
	ldr	r2, [sp, #12]
	ldr	r7, .L19+12
	ldr	r8, .L19+16
	b	.L5
.L3:
	mov	r0, r9
	ldr	r1, [r6]
	add	r2, sp, #12
	bl	sata_scr_read
	subs	r4, r0, #0
	bne	.L1
	ldr	r2, [sp, #12]
	and	r1, r2, r8
	cmp	r1, #768
	beq	.L4
	subs	r5, r5, #1
	beq	.L16
.L5:
	and	r2, r2, #240
	orr	r2, r2, #768
	mov	r0, r9
	ldr	r1, [r6]
	str	r2, [sp, #12]
	bl	sata_scr_write
	subs	r4, r0, #0
	bne	.L1
	ldr	r1, [r9]
	ldr	r2, [r7]
	tst	r1, r2
	bne	.L3
	mov	r1, #200
	ldr	r0, [r9, #4]
	bl	ata_msleep
	b	.L3
.L4:
	ldr	r2, [fp]
	cmp	r2, r5
	ble	.L9
	mov	r0, r9
	ldr	r1, .L19+20
	sub	r2, r2, r5
	bl	ata_link_warn
.L9:
	mov	r2, r10
	mov	r0, r9
	ldr	r1, [sp, #4]
	bl	sata_link_debounce
	subs	r4, r0, #0
	bne	.L1
	ldr	r5, .L19+24
	mov	r0, r9
	ldr	r1, [r5]
	add	r2, sp, #16
	bl	sata_scr_read
	cmp	r0, #0
	beq	.L17
.L7:
	ldr	r3, .L19+28
	ldr	r3, [r3]
	cmn	r0, r3
	movne	r4, r0
.L1:
	ldr	r3, .L19+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	mov	r0, r9
	ldr	r1, .L19+32
	bl	ata_link_warn
	b	.L1
.L17:
	mov	r0, r9
	ldr	r1, [r5]
	ldr	r2, [sp, #16]
	bl	sata_scr_write
	b	.L7
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	SCR_CONTROL
	.word	.LC2
	.word	ATA_LINK_RESUME_TRIES
	.word	ATA_LFLAG_NO_DB_DELAY
	.word	3855
	.word	.LC0
	.word	SCR_ERROR
	.word	EINVAL
	.word	.LC1
	.size	sata_link_resume, .-sata_link_resume
	.comm	SCR_ERROR,4,4
	.comm	SCR_CONTROL,4,4
	.comm	EINVAL,4,4
	.comm	ATA_LINK_RESUME_TRIES,4,4
	.comm	ATA_LFLAG_NO_DB_DELAY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
