	.file	"extr_siimage.c_sil_set_dma_mode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sil_set_dma_mode, @function
sil_set_dma_mode:
.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
	mov	r13, rdi
	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
	mov	ebx, esi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r15, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR 24[r15]
	call	to_pci_dev@PLT
	mov	r12, QWORD PTR 16[r15]
	mov	rbp, rax
	mov	eax, DWORD PTR 0[r13]
	and	eax, 1
	mov	DWORD PTR 24[rsp], eax
	mov	eax, DWORD PTR [r15]
	and	eax, DWORD PTR IDE_HFLAG_MMIO[rip]
	cmp	QWORD PTR 8[r15], 0
	je	.L2
	test	eax, eax
	je	.L22
	mov	QWORD PTR 8[rsp], 244
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	test	eax, eax
	jne	.L16
	mov	QWORD PTR 8[rsp], 128
.L4:
	mov	rdi, r13
	mov	esi, 8
	call	siimage_seldev@PLT
	mov	esi, 12
	mov	rdi, r13
	mov	r14, rax
	call	siimage_seldev@PLT
	mov	esi, 138
	mov	r13, rax
.L14:
	add	rsi, r12
	mov	rdi, rbp
	call	sil_ioread8@PLT
	mov	rdx, QWORD PTR 8[rsp]
	mov	rdi, rbp
	mov	DWORD PTR 28[rsp], eax
	add	rdx, r12
	mov	rsi, rdx
	mov	QWORD PTR 16[rsp], rdx
	call	sil_ioread8@PLT
	mov	rsi, r14
	mov	rdi, rbp
	mov	r12d, eax
	call	sil_ioread16@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	sil_ioread16@PLT
	cmp	DWORD PTR 24[rsp], 1
	mov	rdi, r15
	sbb	esi, esi
	and	eax, -64
	and	esi, 45
	sub	esi, 49
	and	esi, r12d
	mov	r12d, eax
	mov	DWORD PTR 8[rsp], esi
	call	is_sata@PLT
	mov	ecx, DWORD PTR XFER_UDMA_0[rip]
	mov	rdx, QWORD PTR 16[rsp]
	test	rax, rax
	je	.L6
	cmp	ecx, ebx
	jg	.L7
	sub	ebx, ecx
.L8:
	movsx	rbx, ebx
	lea	rax, ultra6.1959[rip]
	mov	eax, DWORD PTR [rax+rbx*4]
.L10:
	or	r12d, eax
	cmp	DWORD PTR 24[rsp], 1
	mov	r15d, 4289
	sbb	esi, esi
	and	esi, -45
	add	esi, 48
	or	esi, DWORD PTR 8[rsp]
.L12:
	mov	rdi, rbp
	call	sil_iowrite8@PLT
	mov	rdx, r14
	mov	esi, r15d
	mov	rdi, rbp
	call	sil_iowrite16@PLT
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdx, r13
	mov	esi, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	rdi, rbp
	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
	jmp	sil_iowrite16@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	QWORD PTR 8[rsp], 180
.L3:
	mov	rdi, r13
	mov	esi, 8
	call	siimage_seldev@PLT
	mov	esi, 12
	mov	rdi, r13
	mov	r14, rax
	call	siimage_seldev@PLT
	mov	esi, 74
	mov	r13, rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L22:
	mov	QWORD PTR 8[rsp], 132
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	sub	ebx, DWORD PTR XFER_MW_DMA_0[rip]
	cmp	DWORD PTR 24[rsp], 1
	lea	rax, dma.1961[rip]
	sbb	esi, esi
	movsx	rbx, ebx
	and	esi, -30
	mov	r15d, DWORD PTR [rax+rbx*4]
	add	esi, 32
	or	esi, DWORD PTR 8[rsp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L6:
	cmp	ecx, ebx
	jg	.L7
	sub	ebx, ecx
	test	BYTE PTR 28[rsp], 48
	jne	.L8
	movsx	rbx, ebx
	lea	rax, ultra5.1960[rip]
	mov	eax, DWORD PTR [rax+rbx*4]
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	sil_set_dma_mode, .-sil_set_dma_mode
	.section	.rodata
	.align 16
	.type	ultra5.1960, @object
	.size	ultra5.1960, 24
ultra5.1960:
	.long	12
	.long	7
	.long	5
	.long	4
	.long	2
	.long	1
	.align 16
	.type	ultra6.1959, @object
	.size	ultra6.1959, 28
ultra6.1959:
	.long	15
	.long	11
	.long	7
	.long	5
	.long	3
	.long	2
	.long	1
	.align 8
	.type	dma.1961, @object
	.size	dma.1961, 12
dma.1961:
	.long	8712
	.long	4290
	.long	4289
	.comm	XFER_UDMA_0,4,4
	.comm	XFER_MW_DMA_0,4,4
	.comm	IDE_HFLAG_MMIO,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_siimage.c_sil_set_dma_mode.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sil_set_dma_mode, %function
sil_set_dma_mode:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, [r0, #4]
	mov	r5, r0
	sub	sp, sp, #12
	ldr	r0, [r6, #12]
	mov	r9, r1
	bl	to_pci_dev
	ldr	r2, .L23
	ldr	r1, [r6, #4]
	ldr	r3, [r6]
	ldr	r2, [r2]
	ldr	r7, [r5]
	cmp	r1, #0
	mov	r4, r0
	ldr	r10, [r6, #8]
	and	r3, r3, r2
	and	r7, r7, #1
	beq	.L2
	cmp	r3, #0
	moveq	r8, #132
	bne	.L22
.L4:
	mov	r1, #8
	mov	r0, r5
	bl	siimage_seldev
	mov	r1, #12
	mov	fp, r0
	mov	r0, r5
	bl	siimage_seldev
	mov	r1, #138
	mov	r5, r0
.L14:
	add	r1, r1, r10
	mov	r0, r4
	bl	sil_ioread8
	mov	r3, r0
	add	r10, r10, r8
	mov	r1, r10
	mov	r0, r4
	str	r3, [sp, #4]
	bl	sil_ioread8
	mov	r3, r0
	mov	r1, fp
	mov	r0, r4
	str	r3, [sp]
	bl	sil_ioread16
	mov	r1, r5
	mov	r0, r4
	bl	sil_ioread16
	cmp	r7, #0
	mvnne	r1, #48
	mvneq	r1, #3
	ldr	r3, [sp]
	mov	r8, r0
	mov	r0, r6
	and	r6, r1, r3
	bl	is_sata
	ldr	r3, .L23+4
	cmp	r0, #0
	ldr	r1, [r3]
	bic	r8, r8, #63
	beq	.L6
	cmp	r1, r9
	suble	r1, r9, r1
	ble	.L8
.L7:
	cmp	r7, #0
	movne	r1, #32
	moveq	r1, #2
	ldr	r3, .L23+8
	orr	r1, r1, r6
	ldr	r0, [r3]
	ldr	r3, .L23+12
	sub	r9, r9, r0
	add	r9, r3, r9, lsl #2
	ldr	r6, [r9, #52]
.L12:
	mov	r2, r10
	mov	r0, r4
	bl	sil_iowrite8
	mov	r2, fp
	mov	r1, r6
	mov	r0, r4
	bl	sil_iowrite16
	mov	r2, r5
	mov	r1, r8
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	sil_iowrite16
.L6:
	cmp	r1, r9
	bgt	.L7
	ldr	r3, [sp, #4]
	sub	r1, r9, r1
	tst	r3, #48
	bne	.L8
	ldr	r9, .L23+12
	add	r1, r9, r1, lsl #2
	ldr	r3, [r1, #28]
.L10:
	cmp	r7, #0
	movne	r1, #48
	moveq	r1, #3
	orr	r8, r8, r3
	orr	r1, r1, r6
	ldr	r6, .L23+16
	b	.L12
.L2:
	cmp	r3, #0
	moveq	r8, #128
	beq	.L4
	mov	r8, #180
.L3:
	mov	r1, #8
	mov	r0, r5
	bl	siimage_seldev
	mov	r1, #12
	mov	fp, r0
	mov	r0, r5
	bl	siimage_seldev
	mov	r1, #74
	mov	r5, r0
	b	.L14
.L8:
	ldr	r3, .L23+12
	ldr	r3, [r3, r1, lsl #2]
	b	.L10
.L22:
	mov	r8, #244
	b	.L3
.L24:
	.align	2
.L23:
	.word	IDE_HFLAG_MMIO
	.word	XFER_UDMA_0
	.word	XFER_MW_DMA_0
	.word	.LANCHOR0
	.word	4289
	.size	sil_set_dma_mode, .-sil_set_dma_mode
	.comm	XFER_UDMA_0,4,4
	.comm	XFER_MW_DMA_0,4,4
	.comm	IDE_HFLAG_MMIO,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	ultra6.4243, %object
	.size	ultra6.4243, 28
ultra6.4243:
	.word	15
	.word	11
	.word	7
	.word	5
	.word	3
	.word	2
	.word	1
	.type	ultra5.4244, %object
	.size	ultra5.4244, 24
ultra5.4244:
	.word	12
	.word	7
	.word	5
	.word	4
	.word	2
	.word	1
	.type	dma.4245, %object
	.size	dma.4245, 12
dma.4245:
	.word	8712
	.word	4290
	.word	4289
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
