	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2cap_ertm_send
_l2cap_ertm_send:                       ## @l2cap_ertm_send
	.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, %r15
	callq	_l2cap_pi
	movq	%rax, %r12
	movq	_L2CAP_CONN_WAIT_F@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, (%r12)
	jne	LBB0_15
## %bb.1:
	movq	(%r15), %r14
	testq	%r14, %r14
	je	LBB0_15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_l2cap_tx_window_full
	testl	%eax, %eax
	jne	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_L2CAP_CONN_REMOTE_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_skb_clone
	movq	%rax, %r13
	cmpq	$0, 8(%r12)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_bt_cb
	movq	(%rax), %rax
	cmpq	8(%r12), %rax
	je	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_bt_cb
	incq	(%rax)
	movq	_L2CAP_HDR_SIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	8(%r13), %rdi
	callq	_get_unaligned_le16
	movq	_L2CAP_CTRL_REQSEQ_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movl	16(%r12), %edx
	movl	20(%r12), %edi
	shll	%cl, %edx
	movq	_L2CAP_CTRL_TXSEQ_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %edi
	orl	%edx, %edi
	orl	%eax, %edi
	movq	(%rbx), %rsi
	addq	8(%r13), %rsi
	callq	_put_unaligned_le16
	movq	%r15, %rdi
	callq	_l2cap_pi
	movq	24(%rax), %rax
	movq	_L2CAP_FCS_CRC16@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rsi
	movq	(%r13), %rdx
	addq	$-2, %rdx
	xorl	%edi, %edi
	callq	_crc16
	movq	8(%r14), %rcx
	movq	(%r13), %rdx
	leaq	(%rcx,%rdx), %rsi
	addq	$-2, %rsi
	movl	%eax, %edi
	callq	_put_unaligned_le16
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_l2cap_do_send
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	___mod_retrans_timer
	movl	20(%r12), %ebx
	movq	%r14, %rdi
	callq	_bt_cb
	movl	%ebx, 8(%rax)
	movl	20(%r12), %eax
	leal	1(%rax), %ecx
	leal	64(%rax), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	andl	$-64, %edx
	negl	%edx
	addl	%edx, %eax
	incl	%eax
	movl	%eax, 20(%r12)
	incl	32(%r12)
	movq	%r15, %rdi
	callq	_TX_QUEUE
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_skb_queue_is_last
	testq	%rax, %rax
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_TX_QUEUE
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_skb_queue_next
	movq	%rax, %r14
	movq	%rax, (%r15)
	testq	%rax, %rax
	jne	LBB0_2
	jmp	LBB0_14
LBB0_10:
	movl	%eax, %ebx
	movl	36(%r12), %edi
	movq	%r15, %rsi
	callq	_l2cap_send_disconn_req
	jmp	LBB0_15
LBB0_12:
	movq	$0, (%r15)
	jmp	LBB0_14
LBB0_6:
	movl	36(%r12), %edi
	movq	%r15, %rsi
	callq	_l2cap_send_disconn_req
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_L2CAP_CONN_WAIT_F,4,2          ## @L2CAP_CONN_WAIT_F
	.comm	_L2CAP_CONN_REMOTE_BUSY,4,2     ## @L2CAP_CONN_REMOTE_BUSY
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_L2CAP_HDR_SIZE,8,3             ## @L2CAP_HDR_SIZE
	.comm	_L2CAP_CTRL_REQSEQ_SHIFT,4,2    ## @L2CAP_CTRL_REQSEQ_SHIFT
	.comm	_L2CAP_CTRL_TXSEQ_SHIFT,4,2     ## @L2CAP_CTRL_TXSEQ_SHIFT
	.comm	_L2CAP_FCS_CRC16,8,3            ## @L2CAP_FCS_CRC16
	.no_dead_strip	_l2cap_ertm_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2cap_ertm_send
_l2cap_ertm_send:                       ; @l2cap_ertm_send
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	bl	_l2cap_pi
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _L2CAP_CONN_WAIT_F@GOTPAGE
Lloh1:
	ldr	x9, [x9, _L2CAP_CONN_WAIT_F@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_1:
	mov	w22, #0
LBB0_2:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	x21, [x19]
	cbz	x21, LBB0_1
; %bb.4:
	mov	x20, x0
Lloh3:
	adrp	x23, _L2CAP_CONN_REMOTE_BUSY@GOTPAGE
Lloh4:
	ldr	x23, [x23, _L2CAP_CONN_REMOTE_BUSY@GOTPAGEOFF]
Lloh5:
	adrp	x24, _GFP_ATOMIC@GOTPAGE
Lloh6:
	ldr	x24, [x24, _GFP_ATOMIC@GOTPAGEOFF]
Lloh7:
	adrp	x25, _L2CAP_HDR_SIZE@GOTPAGE
Lloh8:
	ldr	x25, [x25, _L2CAP_HDR_SIZE@GOTPAGEOFF]
Lloh9:
	adrp	x26, _L2CAP_CTRL_REQSEQ_SHIFT@GOTPAGE
Lloh10:
	ldr	x26, [x26, _L2CAP_CTRL_REQSEQ_SHIFT@GOTPAGEOFF]
Lloh11:
	adrp	x27, _L2CAP_CTRL_TXSEQ_SHIFT@GOTPAGE
Lloh12:
	ldr	x27, [x27, _L2CAP_CTRL_TXSEQ_SHIFT@GOTPAGEOFF]
Lloh13:
	adrp	x28, _L2CAP_FCS_CRC16@GOTPAGE
Lloh14:
	ldr	x28, [x28, _L2CAP_FCS_CRC16@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_l2cap_tx_window_full
	cbnz	w0, LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x24]
	mov	x0, x21
	bl	_skb_clone
	mov	x22, x0
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_bt_cb
	ldr	x8, [x0]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.eq	LBB0_16
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_bt_cb
	ldr	x8, [x0]
	add	x8, x8, #1
	str	x8, [x0]
	ldr	x8, [x22, #8]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_get_unaligned_le16
	ldr	w8, [x26]
	ldp	w9, w10, [x20, #16]
	lsl	w8, w9, w8
	ldr	w9, [x27]
	lsl	w9, w10, w9
	orr	w8, w8, w0
	orr	w0, w8, w9
	ldr	x8, [x22, #8]
	ldr	x9, [x25]
	add	x1, x9, x8
	bl	_put_unaligned_le16
	mov	x0, x19
	bl	_l2cap_pi
	ldr	x8, [x0, #24]
	ldr	x9, [x28]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x21, #8]
	ldr	x8, [x22]
	sub	x2, x8, #2
	mov	w0, #0
	bl	_crc16
	ldr	x8, [x21, #8]
	ldr	x9, [x22]
	add	x8, x8, x9
	sub	x1, x8, #2
	bl	_put_unaligned_le16
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_l2cap_do_send
	tbnz	w0, #31, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	___mod_retrans_timer
	ldr	w22, [x20, #20]
	mov	x0, x21
	bl	_bt_cb
	str	w22, [x0, #8]
	ldr	w8, [x20, #20]
	add	w8, w8, #1
	negs	w9, w8
	and	w9, w9, #0x3f
	and	w8, w8, #0x3f
	csneg	w8, w8, w9, mi
	str	w8, [x20, #20]
	ldr	w8, [x20, #32]
	add	w8, w8, #1
	str	w8, [x20, #32]
	mov	x0, x19
	bl	_TX_QUEUE
	mov	x1, x21
	bl	_skb_queue_is_last
	cbnz	x0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_TX_QUEUE
	mov	x1, x21
	bl	_skb_queue_next
	mov	x21, x0
	str	x0, [x19]
	cbnz	x0, LBB0_5
	b	LBB0_1
LBB0_14:
	mov	x22, x0
	ldr	w0, [x20, #36]
	mov	x1, x19
	bl	_l2cap_send_disconn_req
	b	LBB0_2
LBB0_15:
	mov	w22, #0
	str	xzr, [x19]
	b	LBB0_2
LBB0_16:
	ldr	w0, [x20, #36]
	mov	x1, x19
	bl	_l2cap_send_disconn_req
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_L2CAP_CONN_WAIT_F,4,2          ; @L2CAP_CONN_WAIT_F
	.comm	_L2CAP_CONN_REMOTE_BUSY,4,2     ; @L2CAP_CONN_REMOTE_BUSY
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_L2CAP_HDR_SIZE,8,3             ; @L2CAP_HDR_SIZE
	.comm	_L2CAP_CTRL_REQSEQ_SHIFT,4,2    ; @L2CAP_CTRL_REQSEQ_SHIFT
	.comm	_L2CAP_CTRL_TXSEQ_SHIFT,4,2     ; @L2CAP_CTRL_TXSEQ_SHIFT
	.comm	_L2CAP_FCS_CRC16,8,3            ; @L2CAP_FCS_CRC16
	.no_dead_strip	_l2cap_ertm_send
.subsections_via_symbols
