	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_get_mode_mask
_ide_get_mode_mask:                     ## @ide_get_mode_mask
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	8(%rdi), %r13
	movq	16(%r13), %r15
	cmpl	$130, %esi
	je	LBB0_11
## %bb.1:
	cmpl	$129, %esi
	je	LBB0_18
## %bb.2:
	cmpl	$128, %esi
	jne	LBB0_22
## %bb.3:
	movq	_ATA_ID_FIELD_VALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%r12d, %r12d
	testb	$4, (%rbx,%rax,4)
	je	LBB0_23
## %bb.4:
	movq	_ATA_ID_UDMA_MODES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %ebx
	testq	%r15, %r15
	je	LBB0_7
## %bb.5:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movl	%edx, %r15d
	callq	*%rax
	movl	%r15d, %edx
	movl	%eax, %r12d
	jmp	LBB0_8
LBB0_11:
	movq	_ATA_ID_MWDMA_MODES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %r12d
	movq	%rbx, %rdi
	callq	_ata_id_is_cfa
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movq	_ATA_ID_CFA_MODES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %ecx
	andl	$56, %ecx
	je	LBB0_14
## %bb.13:
	shrl	$3, %ecx
	decb	%cl
	movl	$16, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	addl	$-8, %eax
	orl	%eax, %r12d
LBB0_14:
	testq	%r15, %r15
	je	LBB0_17
## %bb.15:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	%r14, %rdi
	callq	*%rax
	andl	%eax, %r12d
	jmp	LBB0_23
LBB0_18:
	movq	_ATA_ID_SWDMA_MODES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %r12d
	movq	_ATA_SWDMA2@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	jne	LBB0_21
## %bb.19:
	movq	_ATA_ID_OLD_DMA_MODES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %eax
	cmpl	$256, %eax                      ## imm = 0x100
	jb	LBB0_21
## %bb.20:
	movl	%eax, %ecx
	shrl	$8, %ecx
	movl	$2, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	decl	%edx
	cmpl	$768, %eax                      ## imm = 0x300
	cmovll	%edx, %r12d
LBB0_21:
	andl	8(%r13), %r12d
	jmp	LBB0_23
LBB0_22:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_BUG
	jmp	LBB0_23
LBB0_17:
	andl	4(%r13), %r12d
	jmp	LBB0_23
LBB0_7:
	movl	(%r13), %r12d
LBB0_8:
	andl	%ebx, %r12d
	movq	_XFER_UDMA_2@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jge	LBB0_23
## %bb.9:
	movl	%r12d, %eax
	andl	$120, %eax
	je	LBB0_23
## %bb.10:
	movq	%r14, %rdi
	callq	_eighty_ninty_three
	movl	%r12d, %ecx
	andl	$7, %ecx
	testl	%eax, %eax
	cmovel	%ecx, %r12d
LBB0_23:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_ID_FIELD_VALID,8,3         ## @ATA_ID_FIELD_VALID
	.comm	_ATA_ID_UDMA_MODES,8,3          ## @ATA_ID_UDMA_MODES
	.comm	_XFER_UDMA_2,4,2                ## @XFER_UDMA_2
	.comm	_ATA_ID_MWDMA_MODES,8,3         ## @ATA_ID_MWDMA_MODES
	.comm	_ATA_ID_CFA_MODES,8,3           ## @ATA_ID_CFA_MODES
	.comm	_ATA_ID_SWDMA_MODES,8,3         ## @ATA_ID_SWDMA_MODES
	.comm	_ATA_SWDMA2,4,2                 ## @ATA_SWDMA2
	.comm	_ATA_ID_OLD_DMA_MODES,8,3       ## @ATA_ID_OLD_DMA_MODES
	.no_dead_strip	_ide_get_mode_mask
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_get_mode_mask
_ide_get_mode_mask:                     ; @ide_get_mode_mask
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldp	x21, x22, [x0]
	ldr	x23, [x22, #16]
	cmp	w1, #130
	b.eq	LBB0_7
; %bb.1:
	cmp	w1, #129
	b.eq	LBB0_13
; %bb.2:
	cmp	w1, #128
	b.ne	LBB0_16
; %bb.3:
Lloh0:
	adrp	x8, _ATA_ID_FIELD_VALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_ID_FIELD_VALID@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x21, x8, lsl #2]
	tbz	w8, #2, LBB0_17
; %bb.4:
	mov	x20, x2
Lloh3:
	adrp	x8, _ATA_ID_UDMA_MODES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_ID_UDMA_MODES@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w21, [x21, x8, lsl #2]
	cbz	x23, LBB0_19
; %bb.5:
	ldr	x8, [x23]
	cbz	x8, LBB0_19
; %bb.6:
	mov	x0, x19
	blr	x8
	b	LBB0_20
LBB0_7:
Lloh6:
	adrp	x8, _ATA_ID_MWDMA_MODES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_ID_MWDMA_MODES@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w20, [x21, x8, lsl #2]
	mov	x0, x21
	bl	_ata_id_is_cfa
	cbz	w0, LBB0_10
; %bb.8:
Lloh9:
	adrp	x8, _ATA_ID_CFA_MODES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATA_ID_CFA_MODES@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	w8, [x21, x8, lsl #2]
	ands	w8, w8, #0x38
	b.eq	LBB0_10
; %bb.9:
	lsr	w8, w8, #3
	sub	w8, w8, #1
	mov	w9, #16
	lsl	w8, w9, w8
	sub	w8, w8, #8
	orr	w20, w8, w20
LBB0_10:
	cbz	x23, LBB0_18
; %bb.11:
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_18
; %bb.12:
	mov	x0, x19
	blr	x8
	and	w21, w0, w20
	b	LBB0_22
LBB0_13:
Lloh12:
	adrp	x8, _ATA_ID_SWDMA_MODES@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATA_ID_SWDMA_MODES@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	w8, [x21, x8, lsl #2]
Lloh15:
	adrp	x9, _ATA_SWDMA2@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATA_SWDMA2@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_15
; %bb.14:
Lloh18:
	adrp	x9, _ATA_ID_OLD_DMA_MODES@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_ID_OLD_DMA_MODES@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	ldr	w9, [x21, x9, lsl #2]
	asr	w10, w9, #8
	mov	w11, #2
	lsl	w10, w11, w10
	sub	w10, w10, #1
	cmp	w9, #768
	csel	w10, w10, w8, lt
	cmp	w9, #256
	csel	w8, w8, w10, lo
LBB0_15:
	ldr	w9, [x22, #8]
	and	w21, w9, w8
	b	LBB0_22
LBB0_16:
	bl	_BUG
LBB0_17:
	mov	w21, #0
	b	LBB0_22
LBB0_18:
	ldr	w8, [x22, #4]
	and	w21, w8, w20
	b	LBB0_22
LBB0_19:
	ldr	w0, [x22]
LBB0_20:
	and	w21, w0, w21
Lloh21:
	adrp	x8, _XFER_UDMA_2@GOTPAGE
Lloh22:
	ldr	x8, [x8, _XFER_UDMA_2@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	and	w9, w21, #0x78
	cmp	w8, w20
	ccmp	w9, #0, #4, lt
	b.eq	LBB0_22
; %bb.21:
	mov	x0, x19
	bl	_eighty_ninty_three
	and	w8, w21, #0x7
	cmp	w0, #0
	csel	w21, w8, w21, eq
LBB0_22:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_ID_FIELD_VALID,8,3         ; @ATA_ID_FIELD_VALID
	.comm	_ATA_ID_UDMA_MODES,8,3          ; @ATA_ID_UDMA_MODES
	.comm	_XFER_UDMA_2,4,2                ; @XFER_UDMA_2
	.comm	_ATA_ID_MWDMA_MODES,8,3         ; @ATA_ID_MWDMA_MODES
	.comm	_ATA_ID_CFA_MODES,8,3           ; @ATA_ID_CFA_MODES
	.comm	_ATA_ID_SWDMA_MODES,8,3         ; @ATA_ID_SWDMA_MODES
	.comm	_ATA_SWDMA2,4,2                 ; @ATA_SWDMA2
	.comm	_ATA_ID_OLD_DMA_MODES,8,3       ; @ATA_ID_OLD_DMA_MODES
	.no_dead_strip	_ide_get_mode_mask
.subsections_via_symbols
