	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtsx_base_switch_output_voltage
_rtsx_base_switch_output_voltage:       ## @rtsx_base_switch_output_voltage
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	cmpl	$129, %esi
	je	LBB0_3
## %bb.1:
	cmpl	$128, %r14d
	jne	LBB0_9
## %bb.2:
	movq	_PHY_TUNE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PHY_TUNE_VOLTAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PHY_TUNE_VOLTAGE_3V3@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	jmp	LBB0_7
LBB0_3:
	movq	_PHY_TUNE_D18_1V8@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	movl	$21065, %esi                    ## imm = 0x5249
	callq	_CHK_PCI_PID
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movq	_PHY_BACR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PHY_BACR_BASIC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_rtsx_pci_update_phy
	testl	%eax, %eax
	js	LBB0_10
## %bb.5:
	movq	_PHY_TUNE_D18_1V7@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_6:
	movq	_PHY_TUNE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PHY_TUNE_VOLTAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %ecx
LBB0_7:
	callq	_rtsx_pci_update_phy
	testl	%eax, %eax
	js	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	callq	_rtsx_pci_init_cmd
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_rts5249_fill_driving
	movq	%rbx, %rdi
	movl	$100, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtsx_pci_send_cmd              ## TAILCALL
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_pcr_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_TUNE,4,2                   ## @PHY_TUNE
	.comm	_PHY_TUNE_VOLTAGE_MASK,4,2      ## @PHY_TUNE_VOLTAGE_MASK
	.comm	_PHY_TUNE_VOLTAGE_3V3,4,2       ## @PHY_TUNE_VOLTAGE_3V3
	.comm	_PHY_TUNE_D18_1V8,4,2           ## @PHY_TUNE_D18_1V8
	.comm	_PHY_BACR,4,2                   ## @PHY_BACR
	.comm	_PHY_BACR_BASIC_MASK,4,2        ## @PHY_BACR_BASIC_MASK
	.comm	_PHY_TUNE_D18_1V7,4,2           ## @PHY_TUNE_D18_1V7
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown output voltage %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rtsx_base_switch_output_voltage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtsx_base_switch_output_voltage
_rtsx_base_switch_output_voltage:       ; @rtsx_base_switch_output_voltage
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x19, x0
	cmp	w1, #129
	b.eq	LBB0_3
; %bb.1:
	cmp	w20, #128
	b.ne	LBB0_8
; %bb.2:
Lloh0:
	adrp	x8, _PHY_TUNE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_TUNE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _PHY_TUNE_VOLTAGE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PHY_TUNE_VOLTAGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _PHY_TUNE_VOLTAGE_3V3@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PHY_TUNE_VOLTAGE_3V3@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_rtsx_pci_update_phy
	tbz	w0, #31, LBB0_7
	b	LBB0_9
LBB0_3:
Lloh9:
	adrp	x8, _PHY_TUNE_D18_1V8@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PHY_TUNE_D18_1V8@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	mov	x0, x19
	mov	w1, #21065
	bl	_CHK_PCI_PID
	cbz	w0, LBB0_6
; %bb.4:
Lloh12:
	adrp	x8, _PHY_BACR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PHY_BACR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _PHY_BACR_BASIC_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PHY_BACR_BASIC_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_rtsx_pci_update_phy
	tbnz	w0, #31, LBB0_9
; %bb.5:
Lloh18:
	adrp	x8, _PHY_TUNE_D18_1V7@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PHY_TUNE_D18_1V7@GOTPAGEOFF]
Lloh20:
	ldr	w21, [x8]
LBB0_6:
Lloh21:
	adrp	x8, _PHY_TUNE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PHY_TUNE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _PHY_TUNE_VOLTAGE_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PHY_TUNE_VOLTAGE_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x21
	bl	_rtsx_pci_update_phy
	tbnz	w0, #31, LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_rtsx_pci_init_cmd
	mov	x0, x19
	mov	x1, x20
	bl	_rts5249_fill_driving
	mov	x0, x19
	mov	w1, #100
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_rtsx_pci_send_cmd
LBB0_8:
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pcr_dbg
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_TUNE,4,2                   ; @PHY_TUNE
	.comm	_PHY_TUNE_VOLTAGE_MASK,4,2      ; @PHY_TUNE_VOLTAGE_MASK
	.comm	_PHY_TUNE_VOLTAGE_3V3,4,2       ; @PHY_TUNE_VOLTAGE_3V3
	.comm	_PHY_TUNE_D18_1V8,4,2           ; @PHY_TUNE_D18_1V8
	.comm	_PHY_BACR,4,2                   ; @PHY_BACR
	.comm	_PHY_BACR_BASIC_MASK,4,2        ; @PHY_BACR_BASIC_MASK
	.comm	_PHY_TUNE_D18_1V7,4,2           ; @PHY_TUNE_D18_1V7
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown output voltage %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rtsx_base_switch_output_voltage
.subsections_via_symbols
