	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SIO_SwitchCommandFrame         ## -- Begin function SIO_SwitchCommandFrame
	.p2align	4, 0x90
_SIO_SwitchCommandFrame:                ## @SIO_SwitchCommandFrame
	.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	_TransferStatus@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	testl	%edi, %edi
	je	LBB0_4
## %bb.1:
	movq	_SIO_NoFrame@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_Log_print
LBB0_3:
	movq	_CommandIndex@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_DataIndex@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_ExpectedBytes@GOTPCREL(%rip), %rax
	movl	$5, (%rax)
	movq	_SIO_CommandFrame@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_12
LBB0_4:
	movq	_SIO_StatusRead@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_11
## %bb.5:
	movq	_SIO_NoFrame@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	cmpq	%rax, %rsi
	je	LBB0_11
## %bb.6:
	movq	_SIO_ReadFrame@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	je	LBB0_11
## %bb.7:
	movq	_SIO_CommandFrame@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	jne	LBB0_9
## %bb.8:
	movq	_CommandIndex@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_10
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	callq	_Log_print
	movq	(%r14), %rax
LBB0_10:
	movq	%rax, (%rbx)
LBB0_11:
	movq	_CommandIndex@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TransferStatus,8,3             ## @TransferStatus
	.comm	_SIO_NoFrame,8,3                ## @SIO_NoFrame
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unexpected command frame at state %x."

	.comm	_CommandIndex,8,3               ## @CommandIndex
	.comm	_DataIndex,8,3                  ## @DataIndex
	.comm	_ExpectedBytes,4,2              ## @ExpectedBytes
	.comm	_SIO_CommandFrame,8,3           ## @SIO_CommandFrame
	.comm	_SIO_StatusRead,8,3             ## @SIO_StatusRead
	.comm	_SIO_ReadFrame,8,3              ## @SIO_ReadFrame
L_.str.1:                               ## @.str.1
	.asciz	"Command frame %02x unfinished."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SIO_SwitchCommandFrame         ; -- Begin function SIO_SwitchCommandFrame
	.p2align	2
_SIO_SwitchCommandFrame:                ; @SIO_SwitchCommandFrame
	.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
Lloh0:
	adrp	x19, _TransferStatus@GOTPAGE
Lloh1:
	ldr	x19, [x19, _TransferStatus@GOTPAGEOFF]
	ldr	x1, [x19]
	cbz	w0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _SIO_NoFrame@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SIO_NoFrame@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_3
; %bb.2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_print
LBB0_3:
Lloh7:
	adrp	x8, _CommandIndex@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CommandIndex@GOTPAGEOFF]
Lloh9:
	str	xzr, [x8]
Lloh10:
	adrp	x8, _DataIndex@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DataIndex@GOTPAGEOFF]
Lloh12:
	str	xzr, [x8]
Lloh13:
	adrp	x8, _ExpectedBytes@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ExpectedBytes@GOTPAGEOFF]
	mov	w9, #5
Lloh15:
	str	w9, [x8]
Lloh16:
	adrp	x8, _SIO_CommandFrame@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SIO_CommandFrame@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_9
LBB0_4:
Lloh19:
	adrp	x8, _SIO_StatusRead@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SIO_StatusRead@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x8]
Lloh22:
	adrp	x20, _SIO_NoFrame@GOTPAGE
Lloh23:
	ldr	x20, [x20, _SIO_NoFrame@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh24:
	adrp	x10, _SIO_ReadFrame@GOTPAGE
Lloh25:
	ldr	x10, [x10, _SIO_ReadFrame@GOTPAGEOFF]
Lloh26:
	ldr	x10, [x10]
	cmp	x1, x9
	ccmp	x1, x8, #4, ne
	ccmp	x1, x10, #4, ne
	b.eq	LBB0_8
; %bb.5:
Lloh27:
	adrp	x9, _SIO_CommandFrame@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SIO_CommandFrame@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
Lloh30:
	adrp	x10, _CommandIndex@GOTPAGE
Lloh31:
	ldr	x10, [x10, _CommandIndex@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
	cmp	x1, x9
	ccmp	x10, #0, #0, eq
	b.eq	LBB0_7
; %bb.6:
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Log_print
	ldr	x8, [x20]
LBB0_7:
	str	x8, [x19]
LBB0_8:
Lloh35:
	adrp	x8, _CommandIndex@GOTPAGE
Lloh36:
	ldr	x8, [x8, _CommandIndex@GOTPAGEOFF]
Lloh37:
	str	xzr, [x8]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_TransferStatus,8,3             ; @TransferStatus
	.comm	_SIO_NoFrame,8,3                ; @SIO_NoFrame
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unexpected command frame at state %x."

	.comm	_CommandIndex,8,3               ; @CommandIndex
	.comm	_DataIndex,8,3                  ; @DataIndex
	.comm	_ExpectedBytes,4,2              ; @ExpectedBytes
	.comm	_SIO_CommandFrame,8,3           ; @SIO_CommandFrame
	.comm	_SIO_StatusRead,8,3             ; @SIO_StatusRead
	.comm	_SIO_ReadFrame,8,3              ; @SIO_ReadFrame
l_.str.1:                               ; @.str.1
	.asciz	"Command frame %02x unfinished."

.subsections_via_symbols
