	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hpt3xx_set_mode
_hpt3xx_set_mode:                       ## @hpt3xx_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %rbx
	movl	(%rbx), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_hpt3xx_get_info
	movq	(%rax), %r13
	movslq	(%r12), %r12
	movl	$0, -44(%rbp)
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_get_speed_setting
	movl	%eax, %ebx
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jg	LBB0_4
## %bb.1:
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jle	LBB0_3
## %bb.2:
	addq	$4, %r13
	jmp	LBB0_4
LBB0_3:
	addq	$8, %r13
LBB0_4:
	movl	(%r13), %r13d
	leaq	64(,%r12,4), %r15
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pci_read_config_dword
	movl	-44(%rbp), %eax
	xorl	%eax, %ebx
	andl	%r13d, %ebx
	xorl	%eax, %ebx
	andl	$1073741823, %ebx               ## imm = 0x3FFFFFFF
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_pci_write_config_dword
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_MW_DMA_0,8,3              ## @XFER_MW_DMA_0
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.no_dead_strip	_hpt3xx_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hpt3xx_set_mode
_hpt3xx_set_mode:                       ; @hpt3xx_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #8]
	ldr	w0, [x22]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w0, [x22]
	bl	_hpt3xx_get_info
	mov	x1, x0
	ldr	x23, [x0]
	ldrsw	x22, [x21]
	str	wzr, [sp, #12]
	mov	x0, x20
	bl	_get_speed_setting
	mov	x21, x0
Lloh0:
	adrp	x8, _XFER_MW_DMA_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x20
	b.gt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x9, x23, #8
	add	x10, x23, #4
	cmp	x8, x20
	csel	x23, x9, x10, le
LBB0_2:
	ldr	w23, [x23]
	lsl	x8, x22, #2
	add	x20, x8, #64
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	bic	w8, w8, w23
	and	w9, w23, w21
	orr	w8, w8, w9
	and	w2, w8, #0x3fffffff
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_dword
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_MW_DMA_0,8,3              ; @XFER_MW_DMA_0
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.no_dead_strip	_hpt3xx_set_mode
.subsections_via_symbols
