	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts5209_switch_output_voltage
_rts5209_switch_output_voltage:         ## @rts5209_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_OUTPUT_3V3@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_3
## %bb.1:
	movq	_SD30_DRIVE_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %ecx
	movq	%rbx, %rdi
	movl	$7, %edx
	callq	_rtsx_pci_write_register
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movq	%rbx, %rdi
	movl	$8, %esi
	movl	$20452, %edx                    ## imm = 0x4FE4
	jmp	LBB0_6
LBB0_3:
	movq	_OUTPUT_1V8@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_9
## %bb.4:
	movq	_SD30_DRIVE_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	movq	%rbx, %rdi
	movl	$7, %edx
	callq	_rtsx_pci_write_register
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movq	%rbx, %rdi
	movl	$8, %esi
	movl	$19556, %edx                    ## imm = 0x4C64
LBB0_6:
	callq	_rtsx_pci_write_phy_register
	testl	%eax, %eax
	js	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OUTPUT_3V3,8,3                 ## @OUTPUT_3V3
	.comm	_SD30_DRIVE_SEL,4,2             ## @SD30_DRIVE_SEL
	.comm	_OUTPUT_1V8,8,3                 ## @OUTPUT_1V8
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rts5209_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 rts5209_switch_output_voltage
_rts5209_switch_output_voltage:         ; @rts5209_switch_output_voltage
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _OUTPUT_3V3@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OUTPUT_3V3@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _SD30_DRIVE_SEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SD30_DRIVE_SEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w3, [x19, #4]
	mov	x0, x19
	mov	w2, #7
	bl	_rtsx_pci_write_register
	tbnz	w0, #31, LBB0_8
; %bb.2:
	mov	x0, x19
	mov	w1, #8
	mov	w2, #20452
	bl	_rtsx_pci_write_phy_register
	tbz	w0, #31, LBB0_6
	b	LBB0_8
LBB0_3:
Lloh6:
	adrp	x8, _OUTPUT_1V8@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OUTPUT_1V8@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x1
	b.ne	LBB0_7
; %bb.4:
Lloh9:
	adrp	x8, _SD30_DRIVE_SEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SD30_DRIVE_SEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w3, [x19]
	mov	x0, x19
	mov	w2, #7
	bl	_rtsx_pci_write_register
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	x0, x19
	mov	w1, #8
	mov	w2, #19556
	bl	_rtsx_pci_write_phy_register
	tbnz	w0, #31, LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_OUTPUT_3V3,8,3                 ; @OUTPUT_3V3
	.comm	_SD30_DRIVE_SEL,4,2             ; @SD30_DRIVE_SEL
	.comm	_OUTPUT_1V8,8,3                 ; @OUTPUT_1V8
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rts5209_switch_output_voltage
.subsections_via_symbols
