	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vx_set_clock                   ## -- Begin function vx_set_clock
	.p2align	4, 0x90
_vx_set_clock:                          ## @vx_set_clock
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_VX_STAT_IS_STALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	jne	LBB0_14
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_vx_sync_audio_source
	movq	8(%rbx), %rax
	movq	_VX_CLOCK_MODE_EXTERNAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.2:
	movq	_VX_CLOCK_MODE_AUTO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movq	16(%rbx), %rax
	movq	_VX_AUDIO_SRC_DIGITAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
LBB0_4:
	movq	_UER_SYNC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%rsi, 24(%rbx)
	je	LBB0_12
## %bb.5:
	movq	%rbx, %rdi
	callq	_vx_change_clock_source
	movl	$6, %edi
	callq	_mdelay
	jmp	LBB0_12
LBB0_6:
	movq	_VX_CLOCK_MODE_INTERNAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
LBB0_7:
	movq	_INTERNAL_QUARTZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%rsi, 24(%rbx)
	jne	LBB0_10
## %bb.8:
	cmpl	%r14d, 32(%rbx)
	je	LBB0_14
## %bb.9:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_vx_set_internal_clock
	jmp	LBB0_12
LBB0_10:
	movq	%rbx, %rdi
	callq	_vx_change_clock_source
	cmpl	%r14d, 32(%rbx)
	je	LBB0_14
## %bb.11:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_vx_set_internal_clock
	movq	%rbx, %rdi
	callq	_vx_modify_board_inputs
LBB0_12:
	cmpl	%r14d, 32(%rbx)
	je	LBB0_14
## %bb.13:
	movl	%r14d, 32(%rbx)
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_vx_modify_board_clock
LBB0_14:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VX_STAT_IS_STALE,4,2           ## @VX_STAT_IS_STALE
	.comm	_VX_CLOCK_MODE_EXTERNAL,8,3     ## @VX_CLOCK_MODE_EXTERNAL
	.comm	_VX_CLOCK_MODE_AUTO,8,3         ## @VX_CLOCK_MODE_AUTO
	.comm	_VX_AUDIO_SRC_DIGITAL,8,3       ## @VX_AUDIO_SRC_DIGITAL
	.comm	_UER_SYNC,8,3                   ## @UER_SYNC
	.comm	_VX_CLOCK_MODE_INTERNAL,8,3     ## @VX_CLOCK_MODE_INTERNAL
	.comm	_INTERNAL_QUARTZ,8,3            ## @INTERNAL_QUARTZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vx_set_clock                   ; -- Begin function vx_set_clock
	.p2align	2
_vx_set_clock:                          ; @vx_set_clock
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _VX_STAT_IS_STALE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VX_STAT_IS_STALE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_vx_sync_audio_source
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _VX_CLOCK_MODE_EXTERNAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VX_CLOCK_MODE_EXTERNAL@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.2:
Lloh6:
	adrp	x9, _VX_CLOCK_MODE_AUTO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VX_CLOCK_MODE_AUTO@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x19, #16]
Lloh9:
	adrp	x9, _VX_AUDIO_SRC_DIGITAL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VX_AUDIO_SRC_DIGITAL@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
LBB0_4:
	ldr	x8, [x19, #24]
Lloh12:
	adrp	x9, _UER_SYNC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _UER_SYNC@GOTPAGEOFF]
Lloh14:
	ldr	x1, [x9]
	cmp	x8, x1
	b.eq	LBB0_12
; %bb.5:
	mov	x0, x19
	bl	_vx_change_clock_source
	mov	w0, #6
	bl	_mdelay
	b	LBB0_12
LBB0_6:
Lloh15:
	adrp	x9, _VX_CLOCK_MODE_INTERNAL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _VX_CLOCK_MODE_INTERNAL@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
LBB0_7:
	ldr	x8, [x19, #24]
Lloh18:
	adrp	x9, _INTERNAL_QUARTZ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _INTERNAL_QUARTZ@GOTPAGEOFF]
Lloh20:
	ldr	x1, [x9]
	cmp	x8, x1
	b.ne	LBB0_10
; %bb.8:
	ldr	w8, [x19, #32]
	cmp	w8, w20
	b.eq	LBB0_14
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_vx_set_internal_clock
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	bl	_vx_change_clock_source
	ldr	w8, [x19, #32]
	cmp	w8, w20
	b.eq	LBB0_14
; %bb.11:
	mov	x0, x19
	mov	x1, x20
	bl	_vx_set_internal_clock
	mov	x0, x19
	bl	_vx_modify_board_inputs
LBB0_12:
	ldr	w8, [x19, #32]
	cmp	w8, w20
	b.eq	LBB0_14
; %bb.13:
	str	w20, [x19, #32]
	mov	x0, x19
	mov	w1, #1
	bl	_vx_modify_board_clock
LBB0_14:
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_VX_STAT_IS_STALE,4,2           ; @VX_STAT_IS_STALE
	.comm	_VX_CLOCK_MODE_EXTERNAL,8,3     ; @VX_CLOCK_MODE_EXTERNAL
	.comm	_VX_CLOCK_MODE_AUTO,8,3         ; @VX_CLOCK_MODE_AUTO
	.comm	_VX_AUDIO_SRC_DIGITAL,8,3       ; @VX_AUDIO_SRC_DIGITAL
	.comm	_UER_SYNC,8,3                   ; @UER_SYNC
	.comm	_VX_CLOCK_MODE_INTERNAL,8,3     ; @VX_CLOCK_MODE_INTERNAL
	.comm	_INTERNAL_QUARTZ,8,3            ; @INTERNAL_QUARTZ
.subsections_via_symbols
