	.file	"extr_pata_serverworks.c_serverworks_set_dmamode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	serverworks_set_dmamode, @function
serverworks_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
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR [rdi]
	lea	r13d, [rax+rax]
	mov	eax, DWORD PTR [rsi]
	lea	r14d, 1[r13]
	sub	r14d, eax
	add	r13d, eax
	mov	rax, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR [rax]
	call	to_pci_dev@PLT
	lea	rdx, 4[rsp]
	mov	esi, 84
	mov	rdi, rax
	mov	rbp, rax
	call	pci_read_config_byte@PLT
	mov	eax, DWORD PTR [rbx]
	mov	rdx, rsp
	mov	rdi, rbp
	lea	esi, 86[rax]
	call	pci_read_config_byte@PLT
	mov	eax, DWORD PTR [r12]
	mov	edx, 1
	lea	esi, 68[r14]
	lea	ecx, 0[0+rax*4]
	mov	eax, 15
	sal	eax, cl
	mov	ecx, r13d
	not	eax
	sal	edx, cl
	and	DWORD PTR [rsp], eax
	mov	rax, QWORD PTR 8[r12]
	cmp	rax, QWORD PTR XFER_UDMA_0[rip]
	mov	r13d, edx
	jl	.L2
	mov	edx, 32
	mov	rdi, rbp
	call	pci_write_config_byte@PLT
	mov	ecx, DWORD PTR [r12]
	mov	rdx, QWORD PTR 8[r12]
	sub	rdx, QWORD PTR XFER_UDMA_0[rip]
	or	DWORD PTR 4[rsp], r13d
	sal	ecx, 2
	sal	rdx, cl
	or	edx, DWORD PTR [rsp]
	mov	DWORD PTR [rsp], edx
.L3:
	mov	esi, DWORD PTR [rbx]
	mov	rdi, rbp
	add	esi, 86
	call	pci_write_config_byte@PLT
	mov	edx, DWORD PTR 4[rsp]
	mov	esi, 84
	mov	rdi, rbp
	call	pci_write_config_byte@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
	sub	rax, QWORD PTR XFER_MW_DMA_0[rip]
	lea	rdx, dma_mode.1943[rip]
	mov	rdi, rbp
	not	r13d
	mov	edx, DWORD PTR [rdx+rax*4]
	call	pci_write_config_byte@PLT
	and	DWORD PTR 4[rsp], r13d
	mov	edx, DWORD PTR [rsp]
	jmp	.L3
.L7:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	serverworks_set_dmamode, .-serverworks_set_dmamode
	.section	.rodata
	.align 8
	.type	dma_mode.1943, @object
	.size	dma_mode.1943, 12
dma_mode.1943:
	.long	119
	.long	33
	.long	32
	.comm	XFER_UDMA_0,8,8
	.comm	XFER_MW_DMA_0,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_pata_serverworks.c_serverworks_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	serverworks_set_dmamode, %function
serverworks_set_dmamode:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, [r0]
	ldr	r2, [r0, #4]
	lsl	r3, r3, #1
	ldr	r7, [r1]
	mov	r5, r0
	ldr	r0, [r2]
	ldr	r2, .L8
	sub	sp, sp, #20
	add	r8, r3, #1
	mov	r6, r1
	ldr	r2, [r2]
	str	r2, [sp, #12]
	mov	r2,#0
	sub	r8, r8, r7
	add	r7, r3, r7
	bl	to_pci_dev
	mov	r4, r0
	mov	r1, #84
	add	r2, sp, #8
	bl	pci_read_config_byte
	ldr	r1, [r5]
	add	r2, sp, #4
	add	r1, r1, #86
	mov	r0, r4
	bl	pci_read_config_byte
	mov	r0, #15
	mov	r3, #1
	ldr	r1, [r6]
	ldr	r2, [sp, #4]
	ldr	r9, .L8+4
	lsl	r1, r1, #2
	bic	r2, r2, r0, lsl r1
	ldr	ip, [r9]
	ldr	r0, [r6, #4]
	add	r1, r8, #68
	cmp	r0, ip
	lsl	r7, r3, r7
	str	r2, [sp, #4]
	blt	.L2
	mov	r2, #32
	mov	r0, r4
	bl	pci_write_config_byte
	ldmib	sp, {r2, r3}
	ldr	ip, [r9]
	ldr	r0, [r6, #4]
	ldr	r1, [r6]
	sub	r0, r0, ip
	lsl	r1, r1, #2
	orr	r2, r2, r0, lsl r1
	orr	r7, r3, r7
	stmib	sp, {r2, r7}
.L3:
	ldr	r1, [r5]
	mov	r0, r4
	add	r1, r1, #86
	bl	pci_write_config_byte
	ldr	r2, [sp, #8]
	mov	r0, r4
	mov	r1, #84
	bl	pci_write_config_byte
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L7
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	ldr	r3, .L8+8
	ldr	r2, [r3]
	ldr	r3, .L8+12
	sub	r0, r0, r2
	ldr	r2, [r3, r0, lsl #2]
	mov	r0, r4
	bl	pci_write_config_byte
	ldmib	sp, {r2, r3}
	bic	r7, r3, r7
	str	r7, [sp, #8]
	b	.L3
.L7:
	bl	__stack_chk_fail
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	XFER_UDMA_0
	.word	XFER_MW_DMA_0
	.word	.LANCHOR0
	.size	serverworks_set_dmamode, .-serverworks_set_dmamode
	.comm	XFER_UDMA_0,4,4
	.comm	XFER_MW_DMA_0,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	dma_mode.4227, %object
	.size	dma_mode.4227, 12
dma_mode.4227:
	.word	119
	.word	33
	.word	32
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
