	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2cap_sock_sendmsg
_l2cap_sock_sendmsg:                    ## @l2cap_sock_sendmsg
	.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	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	(%rsi), %r13
	movq	%r13, %rdi
	callq	_l2cap_pi
	movq	%rax, %r15
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_BT_DBG
	movq	%r13, %rdi
	callq	_sock_error
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_30
## %bb.1:
	movq	_MSG_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_4
## %bb.2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_30
LBB0_4:
	movq	(%r13), %rax
	movq	_SOCK_SEQPACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.5:
	cmpl	$130, (%r15)
	jne	LBB0_8
## %bb.6:
	cmpq	%r14, 8(%r15)
	jae	LBB0_8
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_8:
	movq	%r13, %rdi
	callq	_lock_sock
	movq	8(%r13), %rax
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.10:
	movq	(%r13), %rax
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_l2cap_create_connless_pdu
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_l2cap_do_send
	movl	%eax, %ebx
	jmp	LBB0_29
LBB0_9:
	movq	_ENOTCONN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_28:
	subl	(%rax), %ebx
LBB0_29:
	movq	%r13, %rdi
	callq	_release_sock
LBB0_30:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	(%r15), %esi
	leal	-128(%rsi), %eax
	cmpl	$2, %eax
	jae	LBB0_13
## %bb.17:
	cmpq	%r14, 16(%r15)
	jae	LBB0_18
## %bb.23:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_l2cap_sar_segment_sdu
	testl	%eax, %eax
	jns	LBB0_21
## %bb.24:
	movl	%eax, %ebx
	jmp	LBB0_29
LBB0_13:
	cmpl	$130, %esi
	jne	LBB0_27
## %bb.14:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_l2cap_create_basic_pdu
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testl	%eax, %eax
	jne	LBB0_15
## %bb.16:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_l2cap_do_send
	jmp	LBB0_26
LBB0_18:
	movq	_L2CAP_SDU_UNSEGMENTED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	xorl	%r8d, %r8d
	callq	_l2cap_create_iframe_pdu
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testl	%eax, %eax
	je	LBB0_19
LBB0_15:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_29
LBB0_27:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_BT_DBG
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_28
LBB0_19:
	movq	%r13, %rdi
	callq	_TX_QUEUE
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	___skb_queue_tail
	cmpq	$0, 16(%r13)
	jne	LBB0_21
## %bb.20:
	movq	%rbx, 16(%r13)
LBB0_21:
	cmpl	$128, (%r15)
	jne	LBB0_25
## %bb.22:
	movq	%r13, %rdi
	callq	_l2cap_streaming_send
	jmp	LBB0_26
LBB0_25:
	movq	%r13, %rdi
	callq	_l2cap_ertm_send
LBB0_26:
	testl	%eax, %eax
	cmovnel	%eax, %r14d
	movl	%r14d, %ebx
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sock %p, sk %p"

	.comm	_MSG_OOB,4,2                    ## @MSG_OOB
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_SOCK_SEQPACKET,8,3             ## @SOCK_SEQPACKET
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.comm	_ENOTCONN,4,2                   ## @ENOTCONN
	.comm	_SOCK_DGRAM,8,3                 ## @SOCK_DGRAM
	.comm	_L2CAP_SDU_UNSEGMENTED,4,2      ## @L2CAP_SDU_UNSEGMENTED
L_.str.1:                               ## @.str.1
	.asciz	"bad state %1.1x"

	.no_dead_strip	_l2cap_sock_sendmsg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2cap_sock_sendmsg
_l2cap_sock_sendmsg:                    ; @l2cap_sock_sendmsg
	.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	x20, x3
	mov	x22, x2
	mov	x23, x1
	ldr	x19, [x1]
	mov	x0, x19
	bl	_l2cap_pi
	mov	x21, x0
	stp	x23, x19, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
	mov	x0, x19
	bl	_sock_error
	mov	x23, x0
	cbnz	w0, LBB0_14
; %bb.1:
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _MSG_OOB@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MSG_OOB@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_4:
	ldr	x8, [x19]
Lloh7:
	adrp	x9, _SOCK_SEQPACKET@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SOCK_SEQPACKET@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.5:
	ldr	w8, [x21]
	cmp	w8, #130
	b.ne	LBB0_8
; %bb.6:
	ldr	x8, [x21, #8]
	cmp	x8, x20
	b.hs	LBB0_8
; %bb.7:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_3
LBB0_8:
	mov	x0, x19
	bl	_lock_sock
	ldr	x8, [x19, #8]
Lloh12:
	adrp	x9, _BT_CONNECTED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BT_CONNECTED@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.9:
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _SOCK_DGRAM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SOCK_DGRAM@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.10:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_l2cap_create_connless_pdu
	mov	x1, x0
	mov	x0, x19
	bl	_l2cap_do_send
	mov	x23, x0
	b	LBB0_13
LBB0_11:
Lloh18:
	adrp	x8, _ENOTCONN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOTCONN@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_13:
	mov	x0, x19
	bl	_release_sock
LBB0_14:
	mov	x0, x23
	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_15:
	ldr	w8, [x21]
	sub	w9, w8, #128
	cmp	w9, #2
	b.hs	LBB0_19
; %bb.16:
	ldr	x8, [x21, #16]
	cmp	x8, x20
	b.hs	LBB0_22
; %bb.17:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_l2cap_sar_segment_sdu
	tbz	w0, #31, LBB0_29
; %bb.18:
	mov	x23, x0
	b	LBB0_13
LBB0_19:
	cmp	w8, #130
	b.ne	LBB0_25
; %bb.20:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_l2cap_create_basic_pdu
	mov	x21, x0
	bl	_IS_ERR
	cbz	w0, LBB0_26
; %bb.21:
	mov	x0, x21
	b	LBB0_24
LBB0_22:
Lloh20:
	adrp	x8, _L2CAP_SDU_UNSEGMENTED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _L2CAP_SDU_UNSEGMENTED@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	mov	w4, #0
	bl	_l2cap_create_iframe_pdu
	mov	x22, x0
	bl	_IS_ERR
	cbz	w0, LBB0_27
; %bb.23:
	mov	x0, x22
LBB0_24:
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_13
LBB0_25:
	str	x8, [sp]
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_DBG
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_26:
	mov	x0, x19
	mov	x1, x21
	bl	_l2cap_do_send
	b	LBB0_32
LBB0_27:
	mov	x0, x19
	bl	_TX_QUEUE
	mov	x1, x22
	bl	___skb_queue_tail
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_29
; %bb.28:
	str	x22, [x19, #16]
LBB0_29:
	ldr	w8, [x21]
	mov	x0, x19
	cmp	w8, #128
	b.ne	LBB0_31
; %bb.30:
	bl	_l2cap_streaming_send
	b	LBB0_32
LBB0_31:
	bl	_l2cap_ertm_send
LBB0_32:
	cmp	w0, #0
	csel	w23, w20, w0, eq
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sock %p, sk %p"

	.comm	_MSG_OOB,4,2                    ; @MSG_OOB
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_SOCK_SEQPACKET,8,3             ; @SOCK_SEQPACKET
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.comm	_ENOTCONN,4,2                   ; @ENOTCONN
	.comm	_SOCK_DGRAM,8,3                 ; @SOCK_DGRAM
	.comm	_L2CAP_SDU_UNSEGMENTED,4,2      ; @L2CAP_SDU_UNSEGMENTED
l_.str.1:                               ; @.str.1
	.asciz	"bad state %1.1x"

	.no_dead_strip	_l2cap_sock_sendmsg
.subsections_via_symbols
