	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btusb_send_frame
_btusb_send_frame:                      ## @btusb_send_frame
	.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, %r12
	movq	8(%rdi), %r13
	movq	32(%r13), %r15
	movl	(%r13), %esi
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	_HCI_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	24(%r13), %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movq	%r12, %rdi
	callq	_bt_cb
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.2:
	cmpl	$130, %eax
	je	LBB0_12
## %bb.3:
	cmpl	$129, %eax
	jne	LBB0_19
## %bb.4:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_23
## %bb.5:
	movq	%rax, %r14
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$20, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_26
## %bb.6:
	movq	%rax, %rbx
	movl	32(%r15), %eax
	movl	%eax, 16(%rbx)
	movl	$0, 12(%rbx)
	movq	$0, 4(%rbx)
	movl	(%r12), %edi
	callq	___cpu_to_le16
	movl	%eax, (%rbx)
	movl	(%r15), %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movl	(%r15), %esi
	movl	(%r12), %r9d
	movl	4(%r12), %r8d
	movq	_btusb_tx_complete@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	%r14, %rdi
	movl	%eax, %edx
	movq	%rbx, %rcx
	pushq	%r12
	pushq	%r10
	callq	_usb_fill_control_urb
	addq	$16, %rsp
	leaq	12(%r13), %rax
	jmp	LBB0_16
LBB0_7:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_8:
	cmpq	$0, 16(%r15)
	je	LBB0_18
## %bb.9:
	cmpl	$0, 20(%r13)
	jle	LBB0_18
## %bb.10:
	movq	_BTUSB_MAX_ISOC_FRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_29
## %bb.11:
	movq	%rax, %r14
	movl	(%r15), %edi
	movq	16(%r15), %rax
	movl	8(%rax), %esi
	callq	_usb_sndisocpipe
	movl	(%r15), %ecx
	movl	%ecx, 40(%r14)
	movl	%eax, (%r14)
	movq	%r12, 32(%r14)
	movq	_btusb_isoc_tx_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movq	16(%r15), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 20(%r14)
	movq	_URB_ISO_ASAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r14)
	movl	4(%r12), %ecx
	movl	%ecx, 12(%r14)
	movl	(%r12), %ebx
	movl	%ebx, 8(%r14)
	movl	(%rax), %edi
	callq	_le16_to_cpu
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	___fill_isoc_descriptor
	incl	4(%r13)
	jmp	LBB0_24
LBB0_12:
	cmpq	$0, 24(%r15)
	je	LBB0_18
## %bb.13:
	cmpl	$0, 16(%r13)
	jle	LBB0_18
## %bb.14:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	testq	%rax, %rax
	je	LBB0_23
## %bb.15:
	movq	%rax, %r14
	movl	(%r15), %edi
	movq	24(%r15), %rax
	movl	(%rax), %esi
	callq	_usb_sndbulkpipe
	movl	(%r15), %esi
	movl	(%r12), %r8d
	movl	4(%r12), %ecx
	movq	_btusb_tx_complete@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	subq	$8, %rsp
	movq	%r14, %rdi
	movl	%eax, %edx
	pushq	%r12
	callq	_usb_fill_bulk_urb
	addq	$16, %rsp
	leaq	8(%r13), %rax
LBB0_16:
	incl	(%rax)
	movq	%r15, %rdi
	callq	_inc_tx
	testl	%eax, %eax
	je	LBB0_24
## %bb.17:
	leaq	12(%r15), %rsi
	movq	%r14, %rdi
	callq	_usb_anchor_urb
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_schedule_work
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_18:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_19:
	movq	_EILSEQ@GOTPCREL(%rip), %rax
LBB0_20:
	xorl	%ebx, %ebx
LBB0_21:
	subl	(%rax), %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_24:
	leaq	4(%r15), %rsi
	movq	%r14, %rdi
	callq	_usb_anchor_urb
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_usb_submit_urb
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_27
## %bb.25:
	movl	(%r15), %edi
	callq	_usb_mark_last_busy
	jmp	LBB0_28
LBB0_26:
	movq	%r14, %rdi
	callq	_usb_free_urb
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_27:
	movl	(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rdx
	callq	_BT_ERR
	movl	4(%r14), %edi
	callq	_kfree
	movq	%r14, %rdi
	callq	_usb_unanchor_urb
LBB0_28:
	movq	%r14, %rdi
	callq	_usb_free_urb
	jmp	LBB0_22
LBB0_29:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_HCI_RUNNING,4,2                ## @HCI_RUNNING
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_btusb_tx_complete,4,2          ## @btusb_tx_complete
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BTUSB_MAX_ISOC_FRAMES,4,2      ## @BTUSB_MAX_ISOC_FRAMES
	.comm	_btusb_isoc_tx_complete,4,2     ## @btusb_isoc_tx_complete
	.comm	_URB_ISO_ASAP,4,2               ## @URB_ISO_ASAP
	.comm	_EILSEQ,4,2                     ## @EILSEQ
L_.str.1:                               ## @.str.1
	.asciz	"%s urb %p submission failed"

	.no_dead_strip	_btusb_send_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btusb_send_frame
_btusb_send_frame:                      ; @btusb_send_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	ldr	x23, [x0, #8]
	ldr	x19, [x23, #32]
	ldr	w1, [x23]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
Lloh2:
	adrp	x8, _HCI_RUNNING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HCI_RUNNING@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x1, x23, #24
	bl	_test_bit
	cbz	w0, LBB0_7
; %bb.1:
	mov	x0, x21
	bl	_bt_cb
	ldr	w8, [x0]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.2:
	cmp	w8, #130
	b.eq	LBB0_12
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_19
; %bb.4:
Lloh5:
	adrp	x22, _GFP_ATOMIC@GOTPAGE
Lloh6:
	ldr	x22, [x22, _GFP_ATOMIC@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_23
; %bb.5:
	mov	x20, x0
	ldr	w1, [x22]
	mov	w0, #20
	bl	_kmalloc
	cbz	x0, LBB0_22
; %bb.6:
	mov	x22, x0
	ldr	w8, [x19, #32]
	str	w8, [x0, #16]
	str	xzr, [x0, #8]
	str	wzr, [x0, #4]
	ldr	w0, [x21]
	bl	___cpu_to_le16
	str	w0, [x22]
	ldr	w0, [x19]
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x2, x0
	ldr	w1, [x19]
	ldp	w5, w4, [x21]
Lloh7:
	adrp	x8, _btusb_tx_complete@GOTPAGE
Lloh8:
	ldr	x8, [x8, _btusb_tx_complete@GOTPAGEOFF]
Lloh9:
	ldr	w6, [x8]
	mov	x0, x20
	mov	x3, x22
	mov	x7, x21
	bl	_usb_fill_control_urb
	add	x8, x23, #12
	b	LBB0_16
LBB0_7:
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_24
LBB0_8:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_18
; %bb.9:
	ldr	w8, [x23, #20]
	cmp	w8, #0
	b.le	LBB0_18
; %bb.10:
Lloh12:
	adrp	x8, _BTUSB_MAX_ISOC_FRAMES@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BTUSB_MAX_ISOC_FRAMES@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_usb_alloc_urb
	cbz	x0, LBB0_23
; %bb.11:
	mov	x20, x0
	ldr	w0, [x19]
	ldr	x8, [x19, #16]
	ldr	w1, [x8, #8]
	bl	_usb_sndisocpipe
	ldr	w8, [x19]
	str	w8, [x20, #40]
	str	w0, [x20]
	str	x21, [x20, #32]
Lloh18:
	adrp	x8, _btusb_isoc_tx_complete@GOTPAGE
Lloh19:
	ldr	x8, [x8, _btusb_isoc_tx_complete@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x20, #24]
	ldr	x8, [x19, #16]
	ldr	w9, [x8, #4]
Lloh21:
	adrp	x10, _URB_ISO_ASAP@GOTPAGE
Lloh22:
	ldr	x10, [x10, _URB_ISO_ASAP@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	stp	w10, w9, [x20, #16]
	ldr	d0, [x21]
	str	q0, [sp]                        ; 16-byte Folded Spill
	str	d0, [x20, #8]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	mov	x2, x0
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	fmov	w1, s0
	mov	x0, x20
	bl	___fill_isoc_descriptor
	ldr	w8, [x23, #4]
	add	w8, w8, #1
	str	w8, [x23, #4]
	b	LBB0_20
LBB0_12:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_18
; %bb.13:
	ldr	w8, [x23, #16]
	cmp	w8, #0
	b.le	LBB0_18
; %bb.14:
Lloh24:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_23
; %bb.15:
	mov	x20, x0
	ldr	w0, [x19]
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	bl	_usb_sndbulkpipe
	mov	x2, x0
	ldr	w1, [x19]
	ldp	w4, w3, [x21]
Lloh27:
	adrp	x8, _btusb_tx_complete@GOTPAGE
Lloh28:
	ldr	x8, [x8, _btusb_tx_complete@GOTPAGEOFF]
Lloh29:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x6, x21
	bl	_usb_fill_bulk_urb
	add	x8, x23, #8
LBB0_16:
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	mov	x0, x19
	bl	_inc_tx
	cbz	w0, LBB0_20
; %bb.17:
	add	x1, x19, #12
	mov	x0, x20
	bl	_usb_anchor_urb
	add	x0, x19, #8
	bl	_schedule_work
	mov	w21, #0
	b	LBB0_25
LBB0_18:
Lloh30:
	adrp	x8, _ENODEV@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_24
LBB0_19:
Lloh32:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
	b	LBB0_24
LBB0_20:
	add	x1, x19, #4
	mov	x0, x20
	bl	_usb_anchor_urb
Lloh34:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh35:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_usb_submit_urb
	mov	x21, x0
	tbnz	w0, #31, LBB0_26
; %bb.21:
	ldr	w0, [x19]
	bl	_usb_mark_last_busy
	b	LBB0_27
LBB0_22:
	mov	x0, x20
	bl	_usb_free_urb
LBB0_23:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_25:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_26:
	ldr	w1, [x23]
Lloh39:
	adrp	x0, l_.str.1@PAGE
Lloh40:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_BT_ERR
	ldr	w0, [x20, #4]
	bl	_kfree
	mov	x0, x20
	bl	_usb_unanchor_urb
LBB0_27:
	mov	x0, x20
	bl	_usb_free_urb
	b	LBB0_25
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_HCI_RUNNING,4,2                ; @HCI_RUNNING
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_btusb_tx_complete,4,2          ; @btusb_tx_complete
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BTUSB_MAX_ISOC_FRAMES,4,2      ; @BTUSB_MAX_ISOC_FRAMES
	.comm	_btusb_isoc_tx_complete,4,2     ; @btusb_isoc_tx_complete
	.comm	_URB_ISO_ASAP,4,2               ; @URB_ISO_ASAP
	.comm	_EILSEQ,4,2                     ; @EILSEQ
l_.str.1:                               ; @.str.1
	.asciz	"%s urb %p submission failed"

	.no_dead_strip	_btusb_send_frame
.subsections_via_symbols
