	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qmkusbSOFHookI                 ## -- Begin function qmkusbSOFHookI
	.p2align	4, 0x90
_qmkusbSOFHookI:                        ## @qmkusbSOFHookI
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	12(%rax), %edi
	callq	_usbGetDriverStateI
	movq	_USB_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.1:
	movq	(%rbx), %rax
	movq	_QMKUSB_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.2:
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	movl	12(%rax), %edi
	callq	_usbGetTransmitStatusI
	testq	%rax, %rax
	jne	LBB0_7
## %bb.3:
	leaq	16(%rbx), %r14
	movq	%r14, %rdi
	callq	_obqTryFlushI
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	leaq	-24(%rbp), %rsi
	movq	%r14, %rdi
	callq	_obqGetFullBufferI
	movq	%rax, %r14
	movq	8(%rbx), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_6
## %bb.5:
	movq	-24(%rbp), %rcx
	leaq	(%r14,%rcx,4), %rdi
	movq	(%rax), %rdx
	subq	%rcx, %rdx
	xorl	%esi, %esi
	callq	_memset
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
LBB0_6:
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_osalDbgAssert
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	movl	12(%rax), %edi
	movq	-24(%rbp), %rcx
	movq	%r14, %rdx
	callq	_usbStartTransmitI
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_ACTIVE,8,3                 ## @USB_ACTIVE
	.comm	_QMKUSB_READY,8,3               ## @QMKUSB_READY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue is empty"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qmkusbSOFHookI                 ; -- Begin function qmkusbSOFHookI
	.p2align	2
_qmkusbSOFHookI:                        ; @qmkusbSOFHookI
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8, #12]
	bl	_usbGetDriverStateI
Lloh0:
	adrp	x8, _USB_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USB_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.1:
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _QMKUSB_READY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _QMKUSB_READY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldr	x8, [x19, #8]
	ldp	w1, w0, [x8, #8]
	bl	_usbGetTransmitStatusI
	cbnz	x0, LBB0_7
; %bb.3:
	add	x20, x19, #16
	mov	x0, x20
	bl	_obqTryFlushI
	cbz	x0, LBB0_7
; %bb.4:
	add	x1, sp, #8
	mov	x0, x20
	bl	_obqGetFullBufferI
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_6
; %bb.5:
	ldr	x9, [sp, #8]
	add	x0, x20, x9, lsl #2
	ldr	x8, [x8]
	sub	x2, x8, x9
	mov	w1, #0
	bl	_memset
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	str	x8, [sp, #8]
LBB0_6:
	cmp	x20, #0
	cset	w0, ne
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_osalDbgAssert
	ldr	x8, [x19, #8]
	ldp	w1, w0, [x8, #8]
	ldr	x3, [sp, #8]
	mov	x2, x20
	bl	_usbStartTransmitI
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_ACTIVE,8,3                 ; @USB_ACTIVE
	.comm	_QMKUSB_READY,8,3               ; @QMKUSB_READY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue is empty"

.subsections_via_symbols
