	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qmkusbStop                     ## -- Begin function qmkusbStop
	.p2align	4, 0x90
_qmkusbStop:                            ## @qmkusbStop
	.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
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	16(%rax), %r14
	xorl	%edi, %edi
	testq	%rbx, %rbx
	setne	%dil
	callq	_osalDbgCheck
	xorl	%eax, %eax
	callq	_osalSysLock
	movq	(%rbx), %rax
	movq	_QMKUSB_STOP@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	sete	%cl
	movq	_QMKUSB_READY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	leaq	L_.str(%rip), %rsi
	callq	_osalDbgAssert
	movq	(%r14), %rax
	movq	16(%rbx), %rcx
	movl	(%rcx), %ecx
	decl	%ecx
	movq	$0, (%rax,%rcx,8)
	movq	8(%r14), %rax
	movq	16(%rbx), %rcx
	movl	4(%rcx), %ecx
	decl	%ecx
	movq	$0, (%rax,%rcx,8)
	movq	16(%rbx), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rcx
	decl	%eax
	movq	$0, (%rcx,%rax,8)
LBB0_2:
	movq	$0, 16(%rbx)
	movq	(%r15), %rax
	movq	%rax, (%rbx)
	movq	_CHN_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_chnAddFlagsI
	leaq	12(%rbx), %rdi
	callq	_ibqResetI
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_obqResetI
	xorl	%eax, %eax
	callq	_osalOsRescheduleS
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_osalSysUnlock                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_QMKUSB_STOP,8,3                ## @QMKUSB_STOP
	.comm	_QMKUSB_READY,8,3               ## @QMKUSB_READY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid state"

	.comm	_CHN_DISCONNECTED,4,2           ## @CHN_DISCONNECTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qmkusbStop                     ; -- Begin function qmkusbStop
	.p2align	2
_qmkusbStop:                            ; @qmkusbStop
	.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	x19, x0
	ldr	x8, [x0, #16]
	ldr	x20, [x8, #16]
	cmp	x0, #0
	cset	w0, ne
	bl	_osalDbgCheck
	bl	_osalSysLock
	ldr	x8, [x19]
Lloh0:
	adrp	x21, _QMKUSB_STOP@GOTPAGE
Lloh1:
	ldr	x21, [x21, _QMKUSB_STOP@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
Lloh2:
	adrp	x9, _QMKUSB_READY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _QMKUSB_READY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
	cset	w0, eq
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_osalDbgAssert
	ldr	x8, [x20]
	ldr	x9, [x19, #16]
	ldr	w9, [x9]
	sub	w9, w9, #1
	str	xzr, [x8, w9, uxtw #3]
	ldr	x8, [x20, #8]
	ldr	x9, [x19, #16]
	ldr	w9, [x9, #4]
	sub	w9, w9, #1
	str	xzr, [x8, w9, uxtw #3]
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x9, [x20]
	sub	w8, w8, #1
	str	xzr, [x9, w8, uxtw #3]
LBB0_2:
	str	xzr, [x19, #16]
	ldr	x8, [x21]
	str	x8, [x19]
Lloh7:
	adrp	x8, _CHN_DISCONNECTED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CHN_DISCONNECTED@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_chnAddFlagsI
	add	x0, x19, #12
	bl	_ibqResetI
	add	x0, x19, #8
	bl	_obqResetI
	bl	_osalOsRescheduleS
	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	_osalSysUnlock
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_QMKUSB_STOP,8,3                ; @QMKUSB_STOP
	.comm	_QMKUSB_READY,8,3               ; @QMKUSB_READY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid state"

	.comm	_CHN_DISCONNECTED,4,2           ; @CHN_DISCONNECTED
.subsections_via_symbols
