	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ns87415_set_mode
_ns87415_set_mode:                      ## @ns87415_set_mode
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	movl	(%rbx), %r12d
	addl	%r12d, %r12d
	addl	(%r14), %r12d
	leal	(%r12,%r12), %eax
	addl	$68, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	4(%r14), %esi
	leaq	-64(%rbp), %rdx
	movl	$30000, %ecx                    ## imm = 0x7530
	movq	%r14, %rdi
	xorl	%r8d, %r8d
	callq	_ata_timing_compute
	movl	-60(%rbp), %edi
	movl	$17, %r13d
	movl	$2, %esi
	movl	$17, %edx
	callq	_clamp_val
	subl	%eax, %r13d
	movl	-64(%rbp), %edi
	movl	$1, %ebx
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	shll	$4, %eax
	movl	$256, %ecx                      ## imm = 0x100
	subl	%eax, %ecx
	orl	%r13d, %ecx
	movl	%ecx, %edx
	shll	$8, %edx
	orl	%ecx, %edx
	movq	%r15, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_word
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	$66, %esi
	callq	_pci_read_config_byte
	addb	$4, %r12b
	movl	%r12d, %ecx
	shll	%cl, %ebx
	movl	-44(%rbp), %eax
	btrl	%r12d, %eax
	movl	%eax, -44(%rbp)
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rcx
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, (%rcx)
	jle	LBB0_3
## %bb.1:
	movq	%r14, %rdi
	callq	_ata_pio_need_iordy
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movl	-44(%rbp), %eax
LBB0_3:
	orl	%ebx, %eax
	movl	%eax, -44(%rbp)
LBB0_4:
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	$67, %esi
	callq	_pci_read_config_byte
	testb	$3, -48(%rbp)
	je	LBB0_7
## %bb.5:
	leaq	-48(%rbp), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_udelay
	movq	%r15, %rdi
	movl	$67, %esi
	movq	%rbx, %rdx
	callq	_pci_read_config_byte
	testb	$3, -48(%rbp)
	jne	LBB0_6
LBB0_7:
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	movl	$66, %esi
	callq	_pci_write_config_byte
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.no_dead_strip	_ns87415_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ns87415_set_mode
_ns87415_set_mode:                      ; @ns87415_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w8, [x22]
	ldp	w9, w1, [x20]
	add	w23, w9, w8, lsl #1
	lsl	w8, w23, #1
	add	w22, w8, #68
	add	x2, sp, #8
	mov	x0, x20
	mov	w3, #30000
	mov	w4, #0
	bl	_ata_timing_compute
	ldr	w0, [sp, #12]
	mov	w24, #17
	mov	w1, #2
	mov	w2, #17
	bl	_clamp_val
	sub	w24, w24, w0
	ldr	w0, [sp, #8]
	mov	w25, #1
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	mov	w8, #256
	sub	w8, w8, w0, lsl #4
	orr	w8, w8, w24
	orr	w2, w8, w8, lsl #8
	mov	x0, x19
	mov	x1, x22
	bl	_pci_write_config_word
	add	x2, sp, #4
	mov	x0, x19
	mov	w1, #66
	bl	_pci_read_config_byte
	add	w8, w23, #4
	lsl	w22, w25, w8
	ldr	w8, [sp, #4]
	bic	w8, w8, w22
	str	w8, [sp, #4]
Lloh0:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w21
	b.le	LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_ata_pio_need_iordy
	cbnz	w0, LBB0_5
; %bb.2:
	ldr	w8, [sp, #4]
LBB0_3:
	orr	w8, w8, w22
	str	w8, [sp, #4]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #1
	bl	_udelay
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x2, sp
	mov	x0, x19
	mov	w1, #67
	bl	_pci_read_config_byte
	ldrb	w8, [sp]
	tst	w8, #0x3
	b.ne	LBB0_4
; %bb.6:
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	w1, #66
	bl	_pci_write_config_byte
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.no_dead_strip	_ns87415_set_mode
.subsections_via_symbols
