	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_l2cap_write                    ## -- Begin function l2cap_write
	.p2align	4, 0x90
_l2cap_write:                           ## @l2cap_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_L2CAP_ACL_START@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_ERR_OK@GOTPCREL(%rip), %r14
	movq	(%r14), %rbx
	xorl	%eax, %eax
	callq	_lp_pdu_maxsize
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	cmpq	(%r14), %rbx
	jne	LBB0_1
## %bb.3:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	subq	%rbx, %r14
	jle	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	callq	_lp_acl_write
	movq	%rax, %r15
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13), %rax
	cmpq	%rax, %rbx
	jle	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=2
	subq	%rax, %rbx
	movq	8(%r13), %r13
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rsi
	negq	%rsi
	movq	%r13, %rdi
	callq	_btpbuf_header
	addq	%rbx, -48(%rbp)                 ## 8-byte Folded Spill
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rbx
	movq	_L2CAP_ACL_CONT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	L_.str(%rip), %rdi
	callq	_LOG
	testq	%r14, %r14
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %r15
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_4
	jmp	LBB0_12
LBB0_1:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_12
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	callq	_lp_acl_write
	movq	%rax, %rbx
LBB0_12:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_btpbuf_header
	leaq	L_.str.1(%rip), %rdi
	callq	_LOG
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_L2CAP_ACL_START,4,2            ## @L2CAP_ACL_START
	.comm	_ERR_OK,8,3                     ## @ERR_OK
	.comm	_L2CAP_ACL_CONT,4,2             ## @L2CAP_ACL_CONT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"l2cap_write: FRAG\n"

L_.str.1:                               ## @.str.1
	.asciz	"l2cap_write: DONE\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_l2cap_write                    ; -- Begin function l2cap_write
	.p2align	2
_l2cap_write:                           ; @l2cap_write
	.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	x26, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _L2CAP_ACL_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _L2CAP_ACL_START@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
Lloh3:
	adrp	x27, _ERR_OK@GOTPAGE
Lloh4:
	ldr	x27, [x27, _ERR_OK@GOTPAGEOFF]
	ldr	x21, [x27]
	bl	_lp_pdu_maxsize
	mov	x20, #0
	cbz	x26, LBB0_11
; %bb.1:
	ldr	x8, [x27]
	cmp	x21, x8
	b.ne	LBB0_11
; %bb.2:
	mov	x23, x0
	mov	x20, #0
Lloh5:
	adrp	x24, l_.str@PAGE
Lloh6:
	add	x24, x24, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	subs	x28, x26, x23
	b.le	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	x2, x23
	mov	x3, x25
	bl	_lp_acl_write
	mov	x21, x0
	ldr	x8, [x19]
	mov	x25, x23
	cmp	x23, x8
	b.le	LBB0_6
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x19, [x19, #8]
	sub	x25, x25, x8
	ldr	x8, [x19]
	cmp	x25, x8
	b.gt	LBB0_5
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cbz	x25, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	neg	x1, x25
	mov	x0, x19
	bl	_btpbuf_header
	add	x20, x25, x20
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh7:
	adrp	x8, _L2CAP_ACL_CONT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _L2CAP_ACL_CONT@GOTPAGEOFF]
Lloh9:
	ldr	w25, [x8]
	mov	x0, x24
	bl	_LOG
	cbz	x28, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x27]
	mov	x26, x28
	cmp	x21, x8
	b.eq	LBB0_3
	b	LBB0_11
LBB0_10:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x26
	mov	x3, x25
	bl	_lp_acl_write
	mov	x21, x0
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	bl	_btpbuf_header
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LOG
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_L2CAP_ACL_START,4,2            ; @L2CAP_ACL_START
	.comm	_ERR_OK,8,3                     ; @ERR_OK
	.comm	_L2CAP_ACL_CONT,4,2             ; @L2CAP_ACL_CONT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"l2cap_write: FRAG\n"

l_.str.1:                               ; @.str.1
	.asciz	"l2cap_write: DONE\n"

.subsections_via_symbols
