	.file	"extr_amd74xx.c_amd_set_drive.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	amd_set_drive, @function
amd_set_drive:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rbp, QWORD PTR 16[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	edi, DWORD PTR 8[rbp]
	call	to_pci_dev@PLT
	mov	rdi, rbx
	mov	QWORD PTR [rsp], rax
	call	ide_get_pair_dev@PLT
	mov	r13, QWORD PTR 0[rbp]
	mov	r9, rax
	mov	eax, 1000000000
	cdq
	idiv	DWORD PTR amd_clock[rip]
	cmp	QWORD PTR ATA_UDMA2[rip], r13
	mov	r15d, eax
	mov	ebp, eax
	je	.L2
	shr	ebp, 31
	add	ebp, eax
	sar	ebp
.L2:
	lea	r14, 16[rsp]
	mov	r8d, ebp
	mov	ecx, r15d
	mov	rsi, r12
	mov	rdx, r14
	mov	rdi, rbx
	mov	QWORD PTR 8[rsp], r9
	call	ide_timing_compute@PLT
	mov	r9, QWORD PTR 8[rsp]
	test	r9, r9
	je	.L3
	lea	r11, 20[rsp]
	mov	rsi, QWORD PTR [r9]
	mov	ecx, r15d
	mov	rdi, r9
	mov	rdx, r11
	mov	r8d, ebp
	mov	QWORD PTR 8[rsp], r11
	call	ide_timing_compute@PLT
	mov	r11, QWORD PTR 8[rsp]
	mov	rdx, r14
	mov	rsi, r14
	mov	ecx, DWORD PTR IDE_TIMING_8BIT[rip]
	mov	rdi, r11
	call	ide_timing_merge@PLT
.L3:
	cmp	QWORD PTR XFER_UDMA_5[rip], r12
	je	.L16
	cmp	QWORD PTR XFER_UDMA_6[rip], r12
	je	.L17
.L6:
	mov	esi, DWORD PTR 8[rbx]
	mov	rdi, QWORD PTR [rsp]
	mov	rcx, r14
	mov	rdx, r13
	call	amd_set_speed@PLT
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L17:
	.cfi_restore_state
	cmp	DWORD PTR amd_clock[rip], 33333
	jle	.L8
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	cmp	DWORD PTR amd_clock[rip], 33333
	jg	.L6
	cmp	QWORD PTR XFER_UDMA_6[rip], r12
	mov	DWORD PTR 16[rsp], 1
	jne	.L6
.L8:
	mov	DWORD PTR 16[rsp], 15
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	amd_set_drive, .-amd_set_drive
	.comm	amd_clock,4,4
	.comm	XFER_UDMA_6,8,8
	.comm	XFER_UDMA_5,8,8
	.comm	IDE_TIMING_8BIT,4,4
	.comm	ATA_UDMA2,8,8
	.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_amd74xx.c_amd_set_drive.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	amd_set_drive, %function
amd_set_drive:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r5, [r0, #8]
	ldr	r3, .L19
	sub	sp, sp, #36
	mov	r4, r0
	ldr	r0, [r5, #4]
	mov	r6, r1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	to_pci_dev
	mov	r8, r0
	mov	r0, r4
	bl	ide_get_pair_dev
	ldr	fp, .L19+4
	mov	r7, r0
	ldr	r1, [fp]
	ldr	r0, .L19+8
	bl	__aeabi_idiv
	ldr	r3, .L19+12
	ldr	r10, [r5]
	ldr	r2, [r3]
	mov	r5, r0
	cmp	r2, r10
	moveq	r9, r0
	addne	r9, r0, r0, lsr #31
	asrne	r9, r9, #1
	mov	r3, r0
	mov	r1, r6
	mov	r0, r4
	str	r9, [sp]
	add	r2, sp, #20
	bl	ide_timing_compute
	cmp	r7, #0
	beq	.L3
	ldr	r1, [r7]
	mov	r3, r5
	add	r2, sp, #24
	mov	r0, r7
	str	r9, [sp]
	bl	ide_timing_compute
	ldr	r3, .L19+16
	add	r2, sp, #20
	mov	r1, r2
	ldr	r3, [r3]
	add	r0, sp, #24
	bl	ide_timing_merge
.L3:
	ldr	r3, .L19+20
	ldr	r2, .L19+24
	ldr	r3, [r3]
	ldr	r2, [r2]
	cmp	r3, r6
	str	r2, [sp, #12]
	beq	.L16
	ldr	r3, [sp, #12]
	cmp	r3, r6
	beq	.L17
.L6:
	mov	r2, r10
	add	r3, sp, #20
	mov	r0, r8
	ldr	r1, [r4, #4]
	bl	amd_set_speed
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	ldr	r2, [fp]
	ldr	r3, .L19+28
	cmp	r2, r3
	ble	.L8
	b	.L6
.L16:
	ldr	r2, [fp]
	ldr	r3, .L19+28
	cmp	r2, r3
	bgt	.L6
	mov	r3, #1
	ldr	r2, [sp, #12]
	str	r3, [sp, #20]
	cmp	r2, r6
	bne	.L6
.L8:
	mov	r3, #15
	str	r3, [sp, #20]
	b	.L6
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	amd_clock
	.word	1000000000
	.word	ATA_UDMA2
	.word	IDE_TIMING_8BIT
	.word	XFER_UDMA_5
	.word	XFER_UDMA_6
	.word	33333
	.size	amd_set_drive, .-amd_set_drive
	.comm	amd_clock,4,4
	.comm	XFER_UDMA_6,4,4
	.comm	XFER_UDMA_5,4,4
	.comm	IDE_TIMING_8BIT,4,4
	.comm	ATA_UDMA2,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
