	.file	"extr_sis5513.c_sis_ata16_program_timings.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sis_ata16_program_timings, @function
sis_ata16_program_timings:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	sub	rsp, 48
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR [rax]
	call	to_pci_dev@PLT
	mov	rdx, rsp
	mov	DWORD PTR [rsp], 0
	mov	rbp, rax
	mov	eax, DWORD PTR [r12]
	mov	DWORD PTR 32[rsp], 769
	mov	rdi, rbp
	mov	DWORD PTR 12[rsp], 769
	lea	r12d, 64[rax+rax]
	movabs	rax, 6627134537728
	mov	QWORD PTR 16[rsp], rax
	movsx	r12, r12d
	movabs	rax, 3311419786244
	mov	QWORD PTR 24[rsp], rax
	mov	rsi, r12
	movabs	rax, 3307124817928
	mov	QWORD PTR 4[rsp], rax
	call	pci_read_config_word@PLT
	mov	ecx, DWORD PTR [rsp]
	mov	rax, QWORD PTR XFER_MW_DMA_0[rip]
	mov	edx, ecx
	and	edx, -1808
	cmp	rax, rbx
	jg	.L2
	mov	rsi, QWORD PTR ATA_16[rip]
	cmp	QWORD PTR chipset_family[rip], rsi
	jg	.L8
.L3:
	sub	rbx, rax
	or	edx, DWORD PTR 4[rsp+rbx*4]
	mov	DWORD PTR [rsp], edx
.L4:
	mov	rsi, r12
	mov	rdi, rbp
	call	pci_write_config_word@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L9
	add	rsp, 48
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	sub	rbx, QWORD PTR XFER_PIO_0[rip]
	or	edx, DWORD PTR 16[rsp+rbx*4]
	mov	DWORD PTR [rsp], edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	and	ecx, -34576
	mov	edx, ecx
	jmp	.L3
.L9:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sis_ata16_program_timings, .-sis_ata16_program_timings
	.comm	chipset_family,8,8
	.comm	XFER_PIO_0,8,8
	.comm	XFER_MW_DMA_0,8,8
	.comm	ATA_16,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_sis5513.c_sis_ata16_program_timings.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sis_ata16_program_timings, %function
sis_ata16_program_timings:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, [r0, #4]
	mov	r4, r0
	ldr	r0, [r3]
	ldr	r3, .L9
	sub	sp, sp, #40
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	bl	to_pci_dev
	ldr	ip, .L9+4
	mov	r6, r0
	ldmia	ip!, {r0, r1, r2, r3}
	mov	lr, ip
	mov	r7, #0
	add	ip, sp, #16
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r4, [r4]
	ldr	r8, [lr], #4
	add	r4, r4, #32
	add	r3, sp, #4
	lsl	r4, r4, #1
	ldm	lr, {r0, r1, r2}
	stm	r3, {r0, r1, r2}
	mov	r1, r4
	mov	r2, sp
	mov	r0, r6
	str	r8, [ip]
	str	r7, [sp]
	bl	pci_read_config_word
	ldr	r2, .L9+8
	ldr	r3, [sp]
	ldr	r1, [r2]
	bic	r2, r3, #1792
	cmp	r1, r5
	bic	r2, r2, #15
	bgt	.L2
	ldr	ip, .L9+12
	ldr	r0, .L9+16
	ldr	ip, [ip]
	ldr	r0, [r0]
	sub	r1, r5, r1
	cmp	ip, r0
	bicgt	r2, r3, #34560
	add	r3, sp, #40
	add	r1, r3, r1, lsl #2
	ldr	r3, [r1, #-36]
	bicgt	r2, r2, #15
	orr	r2, r2, r3
	str	r2, [sp]
.L4:
	mov	r1, r4
	mov	r0, r6
	bl	pci_write_config_word
	ldr	r3, .L9
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L8
	add	sp, sp, #40
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r3, .L9+20
	ldr	r1, [r3]
	add	r3, sp, #40
	sub	r5, r5, r1
	add	r5, r3, r5, lsl #2
	ldr	r3, [r5, #-24]
	orr	r2, r2, r3
	str	r2, [sp]
	b	.L4
.L8:
	bl	__stack_chk_fail
.L10:
	.align	2
.L9:
	.word	.LC2
	.word	.LANCHOR0
	.word	XFER_MW_DMA_0
	.word	chipset_family
	.word	ATA_16
	.word	XFER_PIO_0
	.size	sis_ata16_program_timings, .-sis_ata16_program_timings
	.comm	chipset_family,4,4
	.comm	XFER_PIO_0,4,4
	.comm	XFER_MW_DMA_0,4,4
	.comm	ATA_16,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
.LC0:
	.word	0
	.word	1543
	.word	1028
	.word	771
	.word	769
.LC1:
	.word	8
	.word	770
	.word	769
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
