	.file	"extr_pata_sis.c_sis_66_set_dmamode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sis_66_set_dmamode, @function
sis_66_set_dmamode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [rdi]
	mov	edi, DWORD PTR [rax]
	call	to_pci_dev@PLT
	mov	rdi, rbx
	mov	r13d, DWORD PTR [rbx]
	mov	r14d, DWORD PTR XFER_MW_DMA_0[rip]
	mov	rbp, rax
	call	sis_old_port_base@PLT
	lea	rdx, 4[rsp]
	mov	rdi, rbp
	mov	esi, eax
	mov	r12d, eax
	call	pci_read_config_word@PLT
	movsx	rdx, DWORD PTR [rbx]
	mov	rcx, QWORD PTR XFER_UDMA_0[rip]
	cmp	rdx, rcx
	jge	.L2
	mov	edx, DWORD PTR 4[rsp]
	sub	r13d, r14d
	lea	rax, mwdma_bits.1947[rip]
	movsx	r13, r13d
	and	edx, -34576
	or	edx, DWORD PTR [rax+r13*4]
.L3:
	mov	esi, r12d
	mov	rdi, rbp
	mov	DWORD PTR 4[rsp], edx
	call	pci_write_config_word@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L7
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rax, rdx
	mov	edx, DWORD PTR 4[rsp]
	sub	eax, ecx
	lea	rcx, udma_bits.1948[rip]
	cdqe
	and	dh, 15
	or	edx, DWORD PTR [rcx+rax*4]
	jmp	.L3
.L7:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sis_66_set_dmamode, .-sis_66_set_dmamode
	.section	.rodata
	.align 16
	.type	udma_bits.1948, @object
	.size	udma_bits.1948, 24
udma_bits.1948:
	.long	61440
	.long	53248
	.long	45056
	.long	40960
	.long	36864
	.long	32768
	.align 8
	.type	mwdma_bits.1947, @object
	.size	mwdma_bits.1947, 12
mwdma_bits.1947:
	.long	8
	.long	770
	.long	769
	.comm	XFER_UDMA_0,8,8
	.comm	XFER_MW_DMA_0,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_pata_sis.c_sis_66_set_dmamode.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sis_66_set_dmamode, %function
sis_66_set_dmamode:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, [r0]
	sub	sp, sp, #8
	ldr	r0, [r3]
	ldr	r3, .L8
	mov	r4, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	to_pci_dev
	ldr	r3, .L8+4
	mov	r5, r0
	mov	r0, r4
	ldr	r8, [r3]
	ldr	r7, [r4]
	bl	sis_old_port_base
	mov	r6, r0
	mov	r2, sp
	mov	r0, r5
	mov	r1, r6
	bl	pci_read_config_word
	ldr	r2, .L8+8
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	bge	.L2
	ldr	r3, .L8+12
	ldr	r2, [sp]
	sub	r7, r7, r8
	ldr	r3, [r3, r7, lsl #2]
	bic	r2, r2, #34560
	bic	r2, r2, #15
	orr	r2, r2, r3
.L3:
	mov	r1, r6
	mov	r0, r5
	str	r2, [sp]
	bl	pci_write_config_word
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L7
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r1, .L8+12
	sub	r3, r3, r2
	add	r3, r1, r3, lsl #2
	ldr	r2, [sp]
	ldr	r3, [r3, #12]
	bic	r2, r2, #61440
	orr	r2, r2, r3
	b	.L3
.L7:
	bl	__stack_chk_fail
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	XFER_MW_DMA_0
	.word	XFER_UDMA_0
	.word	.LANCHOR0
	.size	sis_66_set_dmamode, .-sis_66_set_dmamode
	.comm	XFER_UDMA_0,4,4
	.comm	XFER_MW_DMA_0,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	mwdma_bits.4231, %object
	.size	mwdma_bits.4231, 12
mwdma_bits.4231:
	.word	8
	.word	770
	.word	769
	.type	udma_bits.4232, %object
	.size	udma_bits.4232, 24
udma_bits.4232:
	.word	61440
	.word	53248
	.word	45056
	.word	40960
	.word	36864
	.word	32768
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
