	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_switch
_do_switch:                             ## @do_switch
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	%esi, -44(%rbp)
	movl	%esi, %edi
	callq	_get_bus_id
	movl	%eax, %ebx
	leaq	-44(%rbp), %r15
	movq	%r15, %rdi
	callq	_clear_bus_id
	movl	-44(%rbp), %r12d
	movq	(%r14), %r13
	movq	%r14, %rdi
	callq	_MIO_EMM_SWITCH
	addq	%rax, %r13
	movl	%r12d, %edi
	movq	%r13, %rsi
	callq	_writeq
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_set_bus_id
	movl	-44(%rbp), %ebx
	movq	(%r14), %r15
	movq	%r14, %rdi
	callq	_MIO_EMM_SWITCH
	addq	%rax, %r15
	movl	%ebx, %edi
	movq	%r15, %rsi
	callq	_writeq
	movl	$-100, %r15d
	movq	_MIO_EMM_RSP_STS_SWITCH_VAL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_MIO_EMM_RSP_STS
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_readq
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %edi
	callq	_udelay
	incl	%r15d
	jne	LBB0_1
LBB0_3:
	movq	%r14, %rdi
	callq	_check_switch_errors
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIO_EMM_RSP_STS_SWITCH_VAL,4,2 ## @MIO_EMM_RSP_STS_SWITCH_VAL
	.no_dead_strip	_do_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_switch
_do_switch:                             ; @do_switch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	str	w1, [sp, #12]
	mov	x0, x1
	bl	_get_bus_id
	mov	x20, x0
	add	x0, sp, #12
	bl	_clear_bus_id
	ldr	w21, [sp, #12]
	ldr	x22, [x19]
	mov	x0, x19
	bl	_MIO_EMM_SWITCH
	add	x1, x0, x22
	mov	x0, x21
	bl	_writeq
	add	x0, sp, #12
	mov	x1, x20
	bl	_set_bus_id
	ldr	w20, [sp, #12]
	ldr	x21, [x19]
	mov	x0, x19
	bl	_MIO_EMM_SWITCH
	add	x1, x0, x21
	mov	x0, x20
	bl	_writeq
	mov	w20, #-100
Lloh0:
	adrp	x21, _MIO_EMM_RSP_STS_SWITCH_VAL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MIO_EMM_RSP_STS_SWITCH_VAL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x19]
	mov	x0, x19
	bl	_MIO_EMM_RSP_STS
	add	x0, x0, x22
	bl	_readq
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #10
	bl	_udelay
	adds	w20, w20, #1
	b.lo	LBB0_1
LBB0_3:
	mov	x0, x19
	bl	_check_switch_errors
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MIO_EMM_RSP_STS_SWITCH_VAL,4,2 ; @MIO_EMM_RSP_STS_SWITCH_VAL
	.no_dead_strip	_do_switch
.subsections_via_symbols
