	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_cs_create_conn
_hci_cs_create_conn:                    ## @hci_cs_create_conn
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_BT_DBG
	movq	_HCI_OP_CREATE_CONN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_hci_sent_cmd_data
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_hci_dev_lock
	movq	_ACL_LINK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_hci_conn_hash_lookup_ba
	movq	%rax, %r15
	movl	(%r12), %r13d
	movq	%rbx, %rdi
	callq	_batostr
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_BT_DBG
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.2:
	testq	%r15, %r15
	je	LBB0_12
## %bb.3:
	movq	(%r15), %rax
	movq	_BT_CONNECT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.4:
	cmpl	$12, %r14d
	jne	LBB0_6
## %bb.5:
	cmpl	$3, 8(%r15)
	jl	LBB0_7
LBB0_6:
	movq	_BT_CLOSED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_hci_proto_connect_cfm
	movq	%r15, %rdi
	callq	_hci_conn_del
	jmp	LBB0_12
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ACL_LINK@GOTPCREL(%rip), %rax
	testq	%r15, %r15
	jne	LBB0_12
## %bb.9:
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_hci_conn_add
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	$1, 12(%rax)
	movq	_HCI_LM_MASTER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 16(%rax)
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.2(%rip), %rdi
	callq	_BT_ERR
	jmp	LBB0_12
LBB0_7:
	movq	_BT_CONNECT2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
LBB0_12:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hci_dev_unlock                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s status 0x%x"

	.comm	_HCI_OP_CREATE_CONN,4,2         ## @HCI_OP_CREATE_CONN
	.comm	_ACL_LINK,4,2                   ## @ACL_LINK
L_.str.1:                               ## @.str.1
	.asciz	"%s bdaddr %s conn %p"

	.comm	_BT_CONNECT,8,3                 ## @BT_CONNECT
	.comm	_BT_CLOSED,8,3                  ## @BT_CLOSED
	.comm	_BT_CONNECT2,8,3                ## @BT_CONNECT2
	.comm	_HCI_LM_MASTER,4,2              ## @HCI_LM_MASTER
L_.str.2:                               ## @.str.2
	.asciz	"No memmory for new connection"

	.no_dead_strip	_hci_cs_create_conn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_cs_create_conn
_hci_cs_create_conn:                    ; @hci_cs_create_conn
	.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, x1
	mov	x19, x0
	ldr	w1, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	bl	_BT_DBG
Lloh2:
	adrp	x8, _HCI_OP_CREATE_CONN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HCI_OP_CREATE_CONN@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hci_sent_cmd_data
	cbz	x0, LBB0_7
; %bb.1:
	mov	x22, x0
	mov	x0, x19
	bl	_hci_dev_lock
Lloh5:
	adrp	x24, _ACL_LINK@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ACL_LINK@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x22
	bl	_hci_conn_hash_lookup_ba
	mov	x21, x0
	ldr	w23, [x19]
	mov	x0, x22
	bl	_batostr
	mov	x2, x0
	str	x21, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_BT_DBG
	cbz	w20, LBB0_8
; %bb.2:
	cbz	x21, LBB0_13
; %bb.3:
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _BT_CONNECT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BT_CONNECT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.4:
	cmp	w20, #12
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x21, #8]
	cmp	w8, #3
	b.lt	LBB0_12
LBB0_6:
Lloh12:
	adrp	x8, _BT_CLOSED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BT_CLOSED@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x21]
	mov	x0, x21
	mov	x1, x20
	bl	_hci_proto_connect_cfm
	mov	x0, x21
	bl	_hci_conn_del
	b	LBB0_13
LBB0_7:
	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_8:
	cbnz	x21, LBB0_13
; %bb.9:
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x22
	bl	_hci_conn_add
	cbz	x0, LBB0_11
; %bb.10:
Lloh15:
	adrp	x8, _HCI_LM_MASTER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HCI_LM_MASTER@GOTPAGEOFF]
	mov	w9, #1
Lloh17:
	ldr	w8, [x8]
	ldr	w10, [x0, #16]
	orr	w8, w10, w8
	stp	w9, w8, [x0, #12]
	b	LBB0_13
LBB0_11:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_BT_ERR
	b	LBB0_13
LBB0_12:
Lloh20:
	adrp	x8, _BT_CONNECT2@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BT_CONNECT2@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	x8, [x21]
LBB0_13:
	mov	x0, x19
	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
	b	_hci_dev_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s status 0x%x"

	.comm	_HCI_OP_CREATE_CONN,4,2         ; @HCI_OP_CREATE_CONN
	.comm	_ACL_LINK,4,2                   ; @ACL_LINK
l_.str.1:                               ; @.str.1
	.asciz	"%s bdaddr %s conn %p"

	.comm	_BT_CONNECT,8,3                 ; @BT_CONNECT
	.comm	_BT_CLOSED,8,3                  ; @BT_CLOSED
	.comm	_BT_CONNECT2,8,3                ; @BT_CONNECT2
	.comm	_HCI_LM_MASTER,4,2              ; @HCI_LM_MASTER
l_.str.2:                               ; @.str.2
	.asciz	"No memmory for new connection"

	.no_dead_strip	_hci_cs_create_conn
.subsections_via_symbols
