	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pata_icside_set_dmamode
_pata_icside_set_dmamode:               ## @pata_icside_set_dmamode
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movl	8(%rsi), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1000, %ecx                     ## imm = 0x3E8
	movl	$1, %r8d
	callq	_ata_timing_compute
	testq	%rax, %rax
	jne	LBB0_11
## %bb.1:
	movl	-48(%rbp), %ecx
	movl	-44(%rbp), %r8d
	movl	-40(%rbp), %r9d
	cmpl	$50, %ecx
	jg	LBB0_5
## %bb.2:
	cmpl	$375, %r8d                      ## imm = 0x177
	jg	LBB0_5
## %bb.3:
	cmpl	$426, %r9d                      ## imm = 0x1AA
	jge	LBB0_5
## %bb.4:
	movb	$68, %al
	movl	$187, %r12d
	jmp	LBB0_10
LBB0_5:
	cmpl	$125, %ecx
	jg	LBB0_9
## %bb.6:
	cmpl	$375, %r8d                      ## imm = 0x177
	jg	LBB0_9
## %bb.7:
	cmpl	$501, %r9d                      ## imm = 0x1F5
	jge	LBB0_9
## %bb.8:
	movb	$67, %al
	movl	$250, %r12d
	jmp	LBB0_10
LBB0_9:
	cmpl	$201, %ecx
	setl	%al
	cmpl	$551, %r8d                      ## imm = 0x227
	setl	%dl
	andb	%al, %dl
	cmpl	$751, %r9d                      ## imm = 0x2EF
	setl	%al
	andb	%dl, %al
	movl	$437, %edx                      ## imm = 0x1B5
	movl	$562, %r12d                     ## imm = 0x232
	cmovnel	%edx, %r12d
	addb	$65, %al
LBB0_10:
	movq	_KERN_INFO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movzbl	%al, %eax
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ata_dev_printk
	movq	(%r15), %rax
	movq	(%r14), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rbx), %rcx
	movl	%r12d, (%rax,%rcx,4)
LBB0_11:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timings: act %dns rec %dns cyc %dns (%c)\n"

	.no_dead_strip	_pata_icside_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pata_icside_set_dmamode
_pata_icside_set_dmamode:               ; @pata_icside_set_dmamode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	ldr	w1, [x1, #8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #1000
	mov	w4, #1
	bl	_ata_timing_compute
	cbnz	x0, LBB0_11
; %bb.1:
	ldp	w3, w4, [sp]
	ldr	w5, [sp, #8]
	cmp	w3, #50
	b.gt	LBB0_5
; %bb.2:
	cmp	w4, #375
	b.gt	LBB0_5
; %bb.3:
	cmp	w5, #426
	b.ge	LBB0_5
; %bb.4:
	mov	w8, #68
	mov	w22, #187
	b	LBB0_10
LBB0_5:
	cmp	w3, #125
	b.gt	LBB0_9
; %bb.6:
	cmp	w4, #375
	b.gt	LBB0_9
; %bb.7:
	cmp	w5, #501
	b.ge	LBB0_9
; %bb.8:
	mov	w8, #67
	mov	w22, #250
	b	LBB0_10
LBB0_9:
	cmp	w3, #201
	mov	w8, #551
	ccmp	w4, w8, #0, lt
	cset	w8, lt
	cmp	w5, #751
	cset	w9, lt
	tst	w8, w9
	mov	w8, #562
	mov	w9, #437
	csel	w22, w9, w8, ne
	mov	w8, #65
	cinc	w8, w8, ne
LBB0_10:
Lloh0:
	adrp	x9, _KERN_INFO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KERN_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	sxtb	w6, w8
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ata_dev_printk
	ldr	x8, [x21]
	ldr	x9, [x20]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x9, [x19]
	str	w22, [x8, x9, lsl #2]
LBB0_11:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timings: act %dns rec %dns cyc %dns (%c)\n"

	.no_dead_strip	_pata_icside_set_dmamode
.subsections_via_symbols
