	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ubt_bulk_write_callback
_ubt_bulk_write_callback:               ## @ubt_bulk_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, %r14
	leaq	-28(%rbp), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_usbd_xfer_status
	movq	%rbx, %rdi
	callq	_USB_GET_STATE
	cmpl	$129, %eax
	je	LBB0_3
## %bb.1:
	cmpl	$128, %eax
	jne	LBB0_5
## %bb.2:
	movl	-28(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_UBT_INFO
	movl	-28(%rbp), %esi
	movq	%r14, %rdi
	callq	_UBT_STAT_BYTES_SENT
	movq	%r14, %rdi
	callq	_UBT_STAT_PCKTS_SENT
	jmp	LBB0_3
LBB0_5:
	movq	_USB_ERR_CANCELLED@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	je	LBB0_4
## %bb.6:
	movl	%r15d, %edi
	callq	_usbd_errstr
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_UBT_WARN
	movq	%r14, %rdi
	callq	_UBT_STAT_OERROR
	movq	%rbx, %rdi
	callq	_usbd_xfer_set_stall
LBB0_3:
	movq	%r14, %rdi
	callq	_UBT_NG_LOCK
	movq	%r14, %rdi
	callq	_NG_BT_MBUFQ_DEQUEUE
	movq	%r14, %rdi
	callq	_UBT_NG_UNLOCK
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_usbd_xfer_get_frame
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_usbd_m_copy_in
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_usbd_xfer_set_frame_len
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_UBT_INFO
	callq	_NG_FREE_M
	movq	%rbx, %rdi
	callq	_usbd_transfer_submit
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sent %d bytes to bulk-out pipe\n"

L_.str.2:                               ## @.str.2
	.asciz	"bulk-out transfer has been started, len=%d\n"

	.comm	_USB_ERR_CANCELLED,4,2          ## @USB_ERR_CANCELLED
L_.str.3:                               ## @.str.3
	.asciz	"bulk-out transfer failed: %s\n"

	.no_dead_strip	_ubt_bulk_write_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ubt_bulk_write_callback
_ubt_bulk_write_callback:               ; @ubt_bulk_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
	mov	x20, x0
	add	x1, sp, #12
	mov	x0, x19
	mov	x2, #0
	mov	x3, #0
	mov	x4, #0
	bl	_usbd_xfer_status
	mov	x0, x19
	bl	_USB_GET_STATE
	cmp	w0, #129
	b.eq	LBB0_5
; %bb.1:
	cmp	w0, #128
	b.ne	LBB0_3
; %bb.2:
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_UBT_INFO
	ldr	w1, [sp, #12]
	mov	x0, x20
	bl	_UBT_STAT_BYTES_SENT
	mov	x0, x20
	bl	_UBT_STAT_PCKTS_SENT
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _USB_ERR_CANCELLED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _USB_ERR_CANCELLED@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_6
; %bb.4:
	mov	x0, x21
	bl	_usbd_errstr
	mov	x2, x0
Lloh5:
	adrp	x1, l_.str.3@PAGE
Lloh6:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_UBT_WARN
	mov	x0, x20
	bl	_UBT_STAT_OERROR
	mov	x0, x19
	bl	_usbd_xfer_set_stall
LBB0_5:
	mov	x0, x20
	bl	_UBT_NG_LOCK
	mov	x0, x20
	bl	_NG_BT_MBUFQ_DEQUEUE
	mov	x0, x20
	bl	_UBT_NG_UNLOCK
	mov	x0, x19
	mov	w1, #0
	bl	_usbd_xfer_get_frame
	mov	w1, #0
	mov	w3, #0
	bl	_usbd_m_copy_in
	mov	x0, x19
	mov	w1, #0
	bl	_usbd_xfer_set_frame_len
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_UBT_INFO
	bl	_NG_FREE_M
	mov	x0, x19
	bl	_usbd_transfer_submit
LBB0_6:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sent %d bytes to bulk-out pipe\n"

l_.str.2:                               ; @.str.2
	.asciz	"bulk-out transfer has been started, len=%d\n"

	.comm	_USB_ERR_CANCELLED,4,2          ; @USB_ERR_CANCELLED
l_.str.3:                               ; @.str.3
	.asciz	"bulk-out transfer failed: %s\n"

	.no_dead_strip	_ubt_bulk_write_callback
.subsections_via_symbols
