	.file	"extr_ide-dma.c_ide_get_mode_mask.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ide_get_mode_mask, @function
ide_get_mode_mask:
.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
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR 8[rdi]
	mov	r13, QWORD PTR [rdi]
	mov	r14, QWORD PTR 16[rbx]
	cmp	esi, 129
	je	.L2
	mov	rbp, rdi
	cmp	esi, 130
	je	.L3
	cmp	esi, 128
	je	.L42
	xor	eax, eax
	xor	r12d, r12d
	call	BUG@PLT
.L1:
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	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, QWORD PTR ATA_ID_SWDMA_MODES[rip]
	mov	r12d, DWORD PTR 0[r13+rax*4]
	test	DWORD PTR ATA_SWDMA2[rip], r12d
	jne	.L10
	mov	rax, QWORD PTR ATA_ID_OLD_DMA_MODES[rip]
	mov	ecx, DWORD PTR 0[r13+rax*4]
	sar	ecx, 8
	je	.L10
	cmp	ecx, 2
	jle	.L43
.L10:
	and	r12d, DWORD PTR 8[rbx]
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L42:
	.cfi_restore_state
	mov	rax, QWORD PTR ATA_ID_FIELD_VALID[rip]
	xor	r12d, r12d
	test	BYTE PTR 0[r13+rax*4], 4
	je	.L1
	mov	rax, QWORD PTR ATA_ID_UDMA_MODES[rip]
	mov	r12d, DWORD PTR 0[r13+rax*4]
	test	r14, r14
	je	.L6
	mov	rax, QWORD PTR [r14]
	test	rax, rax
	je	.L6
	mov	DWORD PTR 12[rsp], edx
	call	rax
	mov	edx, DWORD PTR 12[rsp]
	and	r12d, eax
.L7:
	cmp	DWORD PTR XFER_UDMA_2[rip], edx
	jge	.L1
	test	r12b, 120
	je	.L1
	mov	rdi, rbp
	call	eighty_ninty_three@PLT
	mov	r8d, eax
	mov	eax, r12d
	and	eax, 7
	test	r8d, r8d
	cmove	r12d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR ATA_ID_MWDMA_MODES[rip]
	mov	rdi, r13
	mov	r12d, DWORD PTR 0[r13+rax*4]
	call	ata_id_is_cfa@PLT
	test	eax, eax
	je	.L8
	mov	rax, QWORD PTR ATA_ID_CFA_MODES[rip]
	mov	ecx, DWORD PTR 0[r13+rax*4]
	test	cl, 56
	je	.L8
	sar	ecx, 3
	mov	eax, 2
	and	ecx, 7
	sub	ecx, 1
	sal	eax, cl
	lea	eax, -8[0+rax*8]
	or	r12d, eax
.L8:
	test	r14, r14
	je	.L9
	mov	rax, QWORD PTR 8[r14]
	test	rax, rax
	je	.L9
	mov	rdi, rbp
	call	rax
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	and	r12d, eax
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	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
.L9:
	.cfi_restore_state
	and	r12d, DWORD PTR 4[rbx]
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L6:
	.cfi_restore_state
	and	r12d, DWORD PTR [rbx]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L43:
	mov	r12d, 2
	sal	r12d, cl
	sub	r12d, 1
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	ide_get_mode_mask, .-ide_get_mode_mask
	.comm	XFER_UDMA_2,4,4
	.comm	ATA_SWDMA2,4,4
	.comm	ATA_ID_UDMA_MODES,8,8
	.comm	ATA_ID_SWDMA_MODES,8,8
	.comm	ATA_ID_OLD_DMA_MODES,8,8
	.comm	ATA_ID_MWDMA_MODES,8,8
	.comm	ATA_ID_FIELD_VALID,8,8
	.comm	ATA_ID_CFA_MODES,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_ide-dma.c_ide_get_mode_mask.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ide_get_mode_mask, %function
ide_get_mode_mask:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r6, [r0, #4]
	cmp	r1, #129
	ldr	r8, [r6, #12]
	ldr	r7, [r0]
	sub	sp, sp, #8
	beq	.L2
	cmp	r1, #130
	mov	r4, r0
	beq	.L3
	cmp	r1, #128
	beq	.L38
	bl	BUG
	mov	r5, #0
.L1:
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r2, .L39
	ldr	r3, .L39+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r5, [r7, r2, lsl #2]
	tst	r5, r3
	bne	.L10
	ldr	r3, .L39+8
	ldr	r3, [r3]
	ldr	r3, [r7, r3, lsl #2]
	asrs	r3, r3, #8
	movne	r2, #1
	moveq	r2, #0
	cmp	r3, #2
	movgt	r2, #0
	andle	r2, r2, #1
	cmp	r2, #0
	mvnne	r5, #1
	mvnne	r5, r5, lsl r3
.L10:
	ldr	r0, [r6, #8]
	and	r5, r5, r0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L38:
	ldr	r3, .L39+12
	ldr	r3, [r3]
	ldr	r5, [r7, r3, lsl #2]
	ands	r5, r5, #4
	beq	.L1
	ldr	r3, .L39+16
	cmp	r8, #0
	ldr	r3, [r3]
	ldr	r5, [r7, r3, lsl #2]
	beq	.L6
	ldr	r3, [r8]
	cmp	r3, #0
	beq	.L6
	str	r2, [sp, #4]
	blx	r3
	ldr	r2, [sp, #4]
	and	r5, r5, r0
.L7:
	ldr	r3, .L39+20
	ldr	r3, [r3]
	cmp	r3, r2
	bge	.L1
	tst	r5, #120
	beq	.L1
	mov	r0, r4
	bl	eighty_ninty_three
	cmp	r0, #0
	andeq	r5, r5, #7
	b	.L1
.L3:
	ldr	r3, .L39+24
	mov	r0, r7
	ldr	r3, [r3]
	ldr	r5, [r7, r3, lsl #2]
	bl	ata_id_is_cfa
	cmp	r0, #0
	beq	.L8
	ldr	r3, .L39+28
	ldr	r3, [r3]
	ldr	r3, [r7, r3, lsl #2]
	tst	r3, #56
	beq	.L8
	mvn	r2, #1
	asr	r3, r3, #3
	and	r3, r3, #7
	sub	r3, r3, #1
	mvn	r3, r2, lsl r3
	orr	r5, r5, r3, lsl #3
.L8:
	cmp	r8, #0
	beq	.L9
	ldr	r3, [r8, #4]
	cmp	r3, #0
	beq	.L9
	mov	r0, r4
	blx	r3
	and	r5, r5, r0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	ldr	r0, [r6, #4]
	and	r5, r5, r0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	ldr	r0, [r6]
	and	r5, r5, r0
	b	.L7
.L40:
	.align	2
.L39:
	.word	ATA_ID_SWDMA_MODES
	.word	ATA_SWDMA2
	.word	ATA_ID_OLD_DMA_MODES
	.word	ATA_ID_FIELD_VALID
	.word	ATA_ID_UDMA_MODES
	.word	XFER_UDMA_2
	.word	ATA_ID_MWDMA_MODES
	.word	ATA_ID_CFA_MODES
	.size	ide_get_mode_mask, .-ide_get_mode_mask
	.comm	XFER_UDMA_2,4,4
	.comm	ATA_SWDMA2,4,4
	.comm	ATA_ID_UDMA_MODES,4,4
	.comm	ATA_ID_SWDMA_MODES,4,4
	.comm	ATA_ID_OLD_DMA_MODES,4,4
	.comm	ATA_ID_MWDMA_MODES,4,4
	.comm	ATA_ID_FIELD_VALID,4,4
	.comm	ATA_ID_CFA_MODES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
