	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_l2cap_signal                   ## -- Begin function l2cap_signal
	.p2align	4, 0x90
_l2cap_signal:                          ## @l2cap_signal
	.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	%r8, %r14
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG
	movq	_l2cap_sigs@GOTPCREL(%rip), %rdi
	callq	_btmemb_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_PBUF_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_L2CAP_HDR_LEN@GOTPCREL(%rip), %r15
	movq	_L2CAP_SIGHDR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	(%r15), %esi
	movq	_PBUF_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_btpbuf_alloc
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rbx
	movslq	(%r15), %r15
	testq	%r14, %r14
	je	LBB0_6
## %bb.7:
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_btpbuf_chain
	movq	%r14, %rdi
	callq	_btpbuf_free
	movl	(%r14), %edi
	callq	_htole16
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
LBB0_2:
	callq	_ERROR
	movq	_ERR_MEM@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_15
LBB0_6:
	xorl	%eax, %eax
LBB0_8:
	movq	%r15, %r14
	movq	%rax, 8(%rbx,%r15,4)
	movl	%r12d, (%rbx,%r15,4)
	testb	$1, %r12b
	jne	LBB0_9
## %bb.10:
	xorl	%eax, %eax
	callq	_l2cap_next_sigid
	movl	%eax, 8(%r13)
	movq	_L2CAP_RTX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r13)
	movq	_L2CAP_MAXRTX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r13)
	movl	(%rbx,%r14,4), %edx
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	jmp	LBB0_11
LBB0_9:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, 8(%r13)
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %edx
LBB0_11:
	xorl	%eax, %eax
	callq	_LOG
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	8(%r13), %eax
	movl	%eax, 4(%rbx,%r14,4)
	movq	(%r13), %rax
	movq	%r14, %r12
	movq	8(%rax), %r14
	movl	(%rax), %edi
	movq	_L2CAP_HDR_LEN@GOTPCREL(%rip), %rax
	subl	(%rax), %edi
	callq	_htole16
	movq	%rax, 8(%r14)
	movq	_L2CAP_SIG_CID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htole16
	movq	%rax, (%r14)
	movq	(%r13), %rsi
	movl	(%rsi), %edx
	movq	%r15, %rdi
	callq	_l2cap_write
	movq	%rax, %r15
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	movl	(%rbx,%r12,4), %edx
	movl	8(%r13), %esi
	cmpq	(%rax), %r15
	jne	LBB0_14
## %bb.12:
	movl	%edx, %eax
	andl	$1, %eax
	jne	LBB0_14
## %bb.13:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_L2CAP_SIG_REG
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG
	movq	(%r13), %rdi
	callq	_btpbuf_free
	movq	$0, (%r13)
	movq	_l2cap_sigs@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	callq	_btmemb_free
LBB0_15:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"l2cap_signal: Allocate memory for l2cap_sig. Code = 0x%x\n"

	.comm	_l2cap_sigs,4,2                 ## @l2cap_sigs
L_.str.1:                               ## @.str.1
	.asciz	"l2cap_signal: could not allocate memory for l2cap_sig\n"

	.comm	_ERR_MEM,8,3                    ## @ERR_MEM
	.comm	_PBUF_RAW,4,2                   ## @PBUF_RAW
	.comm	_L2CAP_HDR_LEN,4,2              ## @L2CAP_HDR_LEN
	.comm	_L2CAP_SIGHDR_LEN,4,2           ## @L2CAP_SIGHDR_LEN
	.comm	_PBUF_RAM,4,2                   ## @PBUF_RAM
L_.str.2:                               ## @.str.2
	.asciz	"l2cap_signal: could not allocate memory for pbuf\n"

L_.str.3:                               ## @.str.3
	.asciz	"l2cap_signal: Sending response/reject signal with id = %d code = %d\n"

	.comm	_L2CAP_RTX,4,2                  ## @L2CAP_RTX
	.comm	_L2CAP_MAXRTX,4,2               ## @L2CAP_MAXRTX
L_.str.4:                               ## @.str.4
	.asciz	"l2cap_signal: Sending request signal with id = %d code = %d\n"

	.comm	_L2CAP_SIG_CID,4,2              ## @L2CAP_SIG_CID
	.comm	_ERR_OK,8,3                     ## @ERR_OK
L_.str.5:                               ## @.str.5
	.asciz	"l2cap_signal: Registering sent request signal with id = %d code = %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"l2cap_signal: Deallocating sent response/reject signal with id = %d code = %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_l2cap_signal                   ; -- Begin function l2cap_signal
	.p2align	2
_l2cap_signal:                          ; @l2cap_signal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x24, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LOG
Lloh2:
	adrp	x0, _l2cap_sigs@GOTPAGE
Lloh3:
	ldr	x0, [x0, _l2cap_sigs@GOTPAGEOFF]
	bl	_btmemb_alloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh4:
	adrp	x8, _PBUF_RAW@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PBUF_RAW@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x26, _L2CAP_HDR_LEN@GOTPAGE
Lloh8:
	ldr	x26, [x26, _L2CAP_HDR_LEN@GOTPAGEOFF]
Lloh9:
	adrp	x8, _L2CAP_SIGHDR_LEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _L2CAP_SIGHDR_LEN@GOTPAGEOFF]
	ldr	w9, [x26]
Lloh11:
	ldr	w8, [x8]
	add	w1, w8, w9
Lloh12:
	adrp	x8, _PBUF_RAM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PBUF_RAM@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_btpbuf_alloc
	str	x0, [x19]
	cbz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x0, #8]
	ldrsw	x9, [x26]
	add	x25, x8, x9, lsl #2
	cbz	x24, LBB0_7
; %bb.3:
	mov	x1, x24
	bl	_btpbuf_chain
	mov	x0, x24
	bl	_btpbuf_free
	ldr	w0, [x24]
	bl	_htole16
	b	LBB0_8
LBB0_4:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_6:
	bl	_ERROR
Lloh19:
	adrp	x8, _ERR_MEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ERR_MEM@GOTPAGEOFF]
Lloh21:
	ldr	x21, [x8]
	b	LBB0_15
LBB0_7:
	mov	x0, #0
LBB0_8:
	str	x0, [x25, #8]
	str	w23, [x25]
	tbnz	w23, #0, LBB0_10
; %bb.9:
	bl	_l2cap_next_sigid
	mov	x1, x0
Lloh22:
	adrp	x8, _L2CAP_RTX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _L2CAP_RTX@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh25:
	adrp	x8, _L2CAP_MAXRTX@GOTPAGE
Lloh26:
	ldr	x8, [x8, _L2CAP_MAXRTX@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	stp	w0, w8, [x19, #8]
	ldr	w8, [x25]
	str	x8, [sp]
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_10:
	str	w22, [x19, #8]
	str	x23, [sp]
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
LBB0_11:
	bl	_LOG
	ldr	w8, [x19, #8]
	str	w8, [x25, #4]
	ldr	x8, [x19]
	ldr	x22, [x8, #8]
	ldr	w8, [x8]
	ldr	w9, [x26]
	sub	w0, w8, w9
	bl	_htole16
	str	x0, [x22, #8]
Lloh32:
	adrp	x8, _L2CAP_SIG_CID@GOTPAGE
Lloh33:
	ldr	x8, [x8, _L2CAP_SIG_CID@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_htole16
	str	x0, [x22]
	ldr	x1, [x19]
	ldr	w2, [x1]
	mov	x0, x21
	bl	_l2cap_write
	mov	x21, x0
Lloh35:
	adrp	x8, _ERR_OK@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ERR_OK@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x8]
	ldr	w8, [x25]
	ldr	w1, [x19, #8]
	cmp	x0, x9
	b.ne	LBB0_14
; %bb.12:
	tbnz	w8, #0, LBB0_14
; %bb.13:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh38:
	adrp	x0, l_.str.5@PAGE
Lloh39:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_LOG
	mov	x0, x20
	mov	x1, x19
	bl	_L2CAP_SIG_REG
	b	LBB0_15
LBB0_14:
	str	x8, [sp]
Lloh40:
	adrp	x0, l_.str.6@PAGE
Lloh41:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_LOG
	ldr	x0, [x19]
	bl	_btpbuf_free
	str	xzr, [x19]
Lloh42:
	adrp	x0, _l2cap_sigs@GOTPAGE
Lloh43:
	ldr	x0, [x0, _l2cap_sigs@GOTPAGEOFF]
	mov	x1, x19
	bl	_btmemb_free
LBB0_15:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"l2cap_signal: Allocate memory for l2cap_sig. Code = 0x%x\n"

	.comm	_l2cap_sigs,4,2                 ; @l2cap_sigs
l_.str.1:                               ; @.str.1
	.asciz	"l2cap_signal: could not allocate memory for l2cap_sig\n"

	.comm	_ERR_MEM,8,3                    ; @ERR_MEM
	.comm	_PBUF_RAW,4,2                   ; @PBUF_RAW
	.comm	_L2CAP_HDR_LEN,4,2              ; @L2CAP_HDR_LEN
	.comm	_L2CAP_SIGHDR_LEN,4,2           ; @L2CAP_SIGHDR_LEN
	.comm	_PBUF_RAM,4,2                   ; @PBUF_RAM
l_.str.2:                               ; @.str.2
	.asciz	"l2cap_signal: could not allocate memory for pbuf\n"

l_.str.3:                               ; @.str.3
	.asciz	"l2cap_signal: Sending response/reject signal with id = %d code = %d\n"

	.comm	_L2CAP_RTX,4,2                  ; @L2CAP_RTX
	.comm	_L2CAP_MAXRTX,4,2               ; @L2CAP_MAXRTX
l_.str.4:                               ; @.str.4
	.asciz	"l2cap_signal: Sending request signal with id = %d code = %d\n"

	.comm	_L2CAP_SIG_CID,4,2              ; @L2CAP_SIG_CID
	.comm	_ERR_OK,8,3                     ; @ERR_OK
l_.str.5:                               ; @.str.5
	.asciz	"l2cap_signal: Registering sent request signal with id = %d code = %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"l2cap_signal: Deallocating sent response/reject signal with id = %d code = %d\n"

.subsections_via_symbols
