	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function optiplus_mode_setup
_optiplus_mode_setup:                   ## @optiplus_mode_setup
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %rdi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ebx
	movl	(%r15), %eax
	leal	(%rbx,%rax,2), %r14d
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r13d, %r12d
	subl	%eax, %r12d
	leaq	-48(%rbp), %rdx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	$68, %esi
	callq	_pci_read_config_byte
	movl	$1, %eax
	movl	%r14d, %ecx
	shll	%cl, %eax
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rcx
	cmpq	%r13, (%rcx)
	jge	LBB0_1
## %bb.2:
	cltq
	orq	-48(%rbp), %rax
	addl	%ebx, %ebx
	movq	%rax, -48(%rbp)
	cmpl	$0, (%r15)
	je	LBB0_4
## %bb.3:
	leaq	-64(%rbp), %rdx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	$69, %esi
	callq	_pci_read_config_byte
	movl	$3, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	notl	%eax
	cltq
	andq	-64(%rbp), %rax
	shll	%cl, %r12d
	movslq	%r12d, %rdx
	orq	%rax, %rdx
	movq	%rdx, -64(%rbp)
	movq	%r14, %rdi
	movl	$69, %esi
	callq	_pci_write_config_byte
	jmp	LBB0_6
LBB0_1:
	notl	%eax
	cltq
	andq	%rax, -48(%rbp)
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	4(%rsi), %edx
	movq	%r15, %rdi
	callq	_optidma_mode_setup
	jmp	LBB0_5
LBB0_4:
	movl	$48, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	notl	%edx
	movslq	%edx, %rdx
	shll	%cl, %r12d
	andq	%rdx, %rax
	movslq	%r12d, %rcx
	orq	%rax, %rcx
	movq	%rcx, -48(%rbp)
LBB0_5:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_6:
	movq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	$68, %esi
	callq	_pci_write_config_byte
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.no_dead_strip	_optiplus_mode_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function optiplus_mode_setup
_optiplus_mode_setup:                   ; @optiplus_mode_setup
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w23, [x21]
	ldr	w8, [x20]
	add	w25, w23, w8, lsl #1
Lloh0:
	adrp	x26, _XFER_UDMA_0@GOTPAGE
Lloh1:
	ldr	x26, [x26, _XFER_UDMA_0@GOTPAGEOFF]
	ldr	w24, [x26]
	add	x2, sp, #8
	mov	w1, #68
	bl	_pci_read_config_byte
	ldr	x9, [x26]
	mov	w8, #1
	lsl	w8, w8, w25
	cmp	x9, x22
	b.ge	LBB0_3
; %bb.1:
	lsl	w21, w23, #1
	sub	w22, w22, w24
	sxtw	x8, w8
	ldr	x9, [sp, #8]
	orr	x8, x9, x8
	str	x8, [sp, #8]
	ldr	w9, [x20]
	cbz	w9, LBB0_4
; %bb.2:
	mov	x2, sp
	mov	x0, x19
	mov	w1, #69
	bl	_pci_read_config_byte
	mov	w8, #3
	lsl	w8, w8, w21
	mvn	w8, w8
	sxtw	x8, w8
	ldr	x9, [sp]
	and	x8, x9, x8
	lsl	w9, w22, w21
	sxtw	x9, w9
	orr	x2, x8, x9
	str	x2, [sp]
	mov	x0, x19
	mov	w1, #69
	bl	_pci_write_config_byte
	b	LBB0_5
LBB0_3:
	mvn	w8, w8
	sxtw	x8, w8
	ldr	x9, [sp, #8]
	and	x8, x9, x8
	str	x8, [sp, #8]
	ldr	w2, [x21, #4]
	mov	x0, x20
	mov	x1, x21
	bl	_optidma_mode_setup
	b	LBB0_5
LBB0_4:
	mov	w9, #48
	lsl	w9, w9, w21
	mvn	w9, w9
	sxtw	x9, w9
	and	x8, x8, x9
	lsl	w9, w22, w21
	sxtw	x9, w9
	orr	x8, x8, x9
	str	x8, [sp, #8]
LBB0_5:
	ldr	x2, [sp, #8]
	mov	x0, x19
	mov	w1, #68
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.no_dead_strip	_optiplus_mode_setup
.subsections_via_symbols
