	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ubtbcmfw_write_callback
_ubtbcmfw_write_callback:               ## @ubtbcmfw_write_callback
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_usbd_xfer_softc
	movq	(%rax), %rax
	movq	_USB_FIFO_TX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %r14
	movq	%rbx, %rdi
	callq	_USB_GET_STATE
	andl	$-2, %eax
	cmpl	$128, %eax
	je	LBB0_1
## %bb.4:
	movq	_USB_ERR_CANCELLED@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	je	LBB0_3
## %bb.5:
	movq	%rbx, %rdi
	callq	_usbd_xfer_set_stall
LBB0_1:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_usbd_xfer_get_frame
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_usbd_xfer_max_len
	leaq	-28(%rbp), %r8
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	movl	%eax, %ecx
	xorl	%r9d, %r9d
	callq	_usb_fifo_get_data
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	-28(%rbp), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_usbd_xfer_set_frame_len
	movq	%rbx, %rdi
	callq	_usbd_transfer_submit
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_FIFO_TX,8,3                ## @USB_FIFO_TX
	.comm	_USB_ERR_CANCELLED,4,2          ## @USB_ERR_CANCELLED
	.no_dead_strip	_ubtbcmfw_write_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ubtbcmfw_write_callback
_ubtbcmfw_write_callback:               ; @ubtbcmfw_write_callback
	.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	x21, x1
	mov	x19, x0
	bl	_usbd_xfer_softc
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _USB_FIFO_TX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _USB_FIFO_TX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x20, [x8, x9, lsl #3]
	mov	x0, x19
	bl	_USB_GET_STATE
	and	w8, w0, #0xfffffffe
	cmp	w8, #128
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _USB_ERR_CANCELLED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _USB_ERR_CANCELLED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_usbd_xfer_set_stall
LBB0_3:
	mov	x0, x19
	mov	w1, #0
	bl	_usbd_xfer_get_frame
	mov	x21, x0
	mov	x0, x19
	bl	_usbd_xfer_max_len
	mov	x3, x0
	add	x4, sp, #12
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	mov	w5, #0
	bl	_usb_fifo_get_data
	cbz	w0, LBB0_5
; %bb.4:
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #0
	bl	_usbd_xfer_set_frame_len
	mov	x0, x19
	bl	_usbd_transfer_submit
LBB0_5:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_FIFO_TX,8,3                ; @USB_FIFO_TX
	.comm	_USB_ERR_CANCELLED,4,2          ; @USB_ERR_CANCELLED
	.no_dead_strip	_ubtbcmfw_write_callback
.subsections_via_symbols
