	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bfusb_rx_complete
_bfusb_rx_complete:                     ## @bfusb_rx_complete
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	24(%rdi), %rcx
	movq	8(%rcx), %r14
	movq	(%rdi), %rbx
	movl	8(%rdi), %r13d
	movl	(%rcx), %r8d
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_BT_DBG
	movq	%r14, %rdi
	callq	_read_lock
	movq	_HCI_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rsi
	addq	$8, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_15
## %bb.1:
	cmpq	$0, 16(%r15)
	jne	LBB0_13
## %bb.2:
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.3:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	addl	%r13d, 4(%rax)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_skb_put
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%r15d, %eax
	addq	%rax, %rbx
	subl	%r15d, %r13d
	je	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	1(%rbx), %r14d
	testb	$64, %r14b
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movzbl	2(%rbx), %r15d
	testl	%r15d, %r15d
	movl	$256, %eax                      ## imm = 0x100
	cmovel	%eax, %r15d
	movl	$3, %ecx
	movl	$-3, %eax
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$2, %ecx
	movl	$-2, %eax
	xorl	%r15d, %r15d
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	addl	%eax, %r13d
	movzbl	(%rbx), %r12d
	cmpl	%r15d, %r13d
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	callq	_BT_ERR
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	%rcx, %rbx
	movl	%r12d, %eax
	andl	$-31, %eax
	cmpl	$193, %eax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	shll	$8, %r14d
	orl	%r12d, %r14d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	callq	_bfusb_recv_block
	jmp	LBB0_11
LBB0_13:
	movl	16(%r14), %eax
	movl	%eax, 12(%r15)
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_usb_submit_urb
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movq	8(%r14), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_BT_ERR
LBB0_15:
	movq	%r14, %rdi
	jmp	LBB0_16
LBB0_12:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	20(%rbx), %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_skb_unlink
	movq	%r14, %rdi
	callq	_kfree_skb
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_bfusb_rx_submit
	movq	%rbx, %rdi
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_read_unlock                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bfusb %p urb %p skb %p len %d"

	.comm	_HCI_RUNNING,4,2                ## @HCI_RUNNING
L_.str.1:                               ## @.str.1
	.asciz	"%s block extends over URB buffer ranges"

	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
L_.str.2:                               ## @.str.2
	.asciz	"%s bulk resubmit failed urb %p err %d"

	.no_dead_strip	_bfusb_rx_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bfusb_rx_complete
_bfusb_rx_complete:                     ; @bfusb_rx_complete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldr	x21, [x0, #24]
	ldr	x19, [x21, #8]
	ldr	x26, [x0]
	ldr	w22, [x0, #8]
	ldr	w4, [x21]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	mov	x3, x21
	bl	_BT_DBG
	mov	x0, x19
	bl	_read_lock
Lloh2:
	adrp	x8, _HCI_RUNNING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HCI_RUNNING@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	add	x1, x8, #8
	bl	_test_bit
	cbz	w0, LBB0_15
; %bb.1:
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_12
; %bb.2:
	cbz	w22, LBB0_12
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	w9, [x8, #4]
	add	w9, w9, w22
	str	w9, [x8, #4]
	mov	x0, x21
	mov	x1, x22
	bl	_skb_put
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x26, x22, w24, uxtw
	subs	w22, w27, w24
	b.eq	LBB0_14
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w28, [x26, #1]
	tbnz	w28, #6, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w8, [x26, #2]
	cmp	w8, #0
	mov	w9, #256
	csel	w24, w9, w8, eq
	mov	w8, #-3
	mov	w23, #3
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w24, #0
	mov	w8, #-2
	mov	w23, #2
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w25, [x26]
	add	w27, w22, w8
	cmp	w27, w24
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_ERR
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x26, x23
	and	w8, w25, #0xffffffe1
	cmp	w8, #193
	b.ne	LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	bfi	w25, w28, #8, #8
	mov	x0, x19
	mov	x1, x25
	mov	x2, x22
	mov	x3, x24
	bl	_bfusb_recv_block
	b	LBB0_4
LBB0_12:
	ldr	w8, [x19, #16]
	str	w8, [x20, #12]
Lloh7:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_usb_submit_urb
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_15
; %bb.13:
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	stp	x20, x0, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_BT_ERR
	b	LBB0_15
LBB0_14:
	add	x1, x19, #20
	mov	x0, x21
	bl	_skb_unlink
	mov	x0, x21
	bl	_kfree_skb
	mov	x0, x19
	mov	x1, x20
	bl	_bfusb_rx_submit
LBB0_15:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_read_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bfusb %p urb %p skb %p len %d"

	.comm	_HCI_RUNNING,4,2                ; @HCI_RUNNING
l_.str.1:                               ; @.str.1
	.asciz	"%s block extends over URB buffer ranges"

	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
l_.str.2:                               ; @.str.2
	.asciz	"%s bulk resubmit failed urb %p err %d"

	.no_dead_strip	_bfusb_rx_complete
.subsections_via_symbols
