	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_conn_complete_evt
_hci_conn_complete_evt:                 ## @hci_conn_complete_evt
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %rbx
	leaq	12(%rbx), %r14
	movq	%r14, %rdi
	callq	_hci_get_link
	movq	%rax, %r15
	movq	(%r12), %rax
	movl	(%rax), %edx
	movq	12(%rbx), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %r8d
	movl	8(%rax), %r9d
	movl	12(%rax), %r10d
	movl	16(%rax), %ebx
	movl	20(%rax), %eax
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	pushq	%rax
	pushq	%rbx
	pushq	%r10
	callq	_LOG
	addq	$32, %rsp
	movq	(%r12), %rax
	movl	(%rax), %ecx
	cmpl	$129, %ecx
	je	LBB0_9
## %bb.1:
	cmpl	$128, %ecx
	jne	LBB0_6
## %bb.2:
	testq	%r15, %r15
	je	LBB0_3
## %bb.5:
	movl	4(%rax), %edi
	callq	_le16toh
	movq	%rax, 8(%r15)
	movq	_hci_dev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_HCI_EVENT_CONN_COMPLETE
	movq	(%r12), %rax
	movl	40(%rax), %esi
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	jmp	LBB0_8
LBB0_6:
	testq	%r15, %r15
	je	LBB0_9
## %bb.7:
	movq	%r15, %rdi
	callq	_hci_close
	movq	(%r12), %rax
	movl	40(%rax), %esi
	movq	_ERR_CONN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lp_connect_cfm                 ## TAILCALL
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%eax, %eax
	callq	_hci_new
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_bd_addr_set
	movq	(%r12), %rax
	movl	4(%rax), %edi
	callq	_le16toh
	movq	%rax, 8(%r15)
	movq	_hci_active_links@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_HCI_REG
	movq	_hci_dev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_HCI_EVENT_CONN_COMPLETE
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lp_connect_ind                 ## TAILCALL
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERROR
	movq	_HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_hci_disconnect
	movq	_HCI_CONN_TERMINATED_BY_LOCAL_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lp_disconnect_ind              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hci_conn_complete_evt(%p,%02x - %02x:%02x:%02x:%02x:%02x:%02x)\n"

L_.str.1:                               ## @.str.1
	.asciz	"hci_conn_complete_evt: Could not allocate memory for link. Disconnect\n"

	.comm	_HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES,4,2 ## @HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES
	.comm	_HCI_CONN_TERMINATED_BY_LOCAL_HOST,4,2 ## @HCI_CONN_TERMINATED_BY_LOCAL_HOST
	.comm	_hci_active_links,4,2           ## @hci_active_links
	.comm	_hci_dev,4,2                    ## @hci_dev
	.comm	_ERR_OK,4,2                     ## @ERR_OK
	.comm	_ERR_CONN,4,2                   ## @ERR_CONN
	.no_dead_strip	_hci_conn_complete_evt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_conn_complete_evt
_hci_conn_complete_evt:                 ; @hci_conn_complete_evt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	ldr	x22, [x0]
	add	x19, x22, #12
	mov	x0, x19
	bl	_hci_get_link
	mov	x21, x0
	ldr	x8, [x20]
	ldr	w2, [x8]
	ldur	x8, [x22, #12]
	ldp	w3, w4, [x8]
	ldp	w5, w6, [x8, #8]
	ldp	w7, w8, [x8, #16]
	str	w8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_LOG
	ldr	x8, [x20]
	ldr	w9, [x8]
	cmp	w9, #129
	b.eq	LBB0_7
; %bb.1:
	cmp	w9, #128
	b.ne	LBB0_4
; %bb.2:
	cbz	x21, LBB0_8
; %bb.3:
	ldr	w0, [x8, #4]
	bl	_le16toh
	str	x0, [x21, #8]
Lloh2:
	adrp	x8, _hci_dev@GOTPAGE
Lloh3:
	ldr	x8, [x8, _hci_dev@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_HCI_EVENT_CONN_COMPLETE
	ldr	x8, [x20]
	ldr	w1, [x8, #40]
Lloh5:
	adrp	x8, _ERR_OK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_OK@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x21
	b	LBB0_6
LBB0_4:
	cbz	x21, LBB0_7
; %bb.5:
	mov	x0, x21
	bl	_hci_close
	ldr	x8, [x20]
	ldr	w1, [x8, #40]
Lloh8:
	adrp	x8, _ERR_CONN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERR_CONN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_lp_connect_cfm
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	bl	_hci_new
	cbz	x0, LBB0_10
; %bb.9:
	mov	x21, x0
	mov	x1, x19
	bl	_bd_addr_set
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_le16toh
	str	x0, [x21, #8]
Lloh11:
	adrp	x0, _hci_active_links@GOTPAGE
Lloh12:
	ldr	x0, [x0, _hci_active_links@GOTPAGEOFF]
	mov	x1, x21
	bl	_HCI_REG
Lloh13:
	adrp	x8, _hci_dev@GOTPAGE
Lloh14:
	ldr	x8, [x8, _hci_dev@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_HCI_EVENT_CONN_COMPLETE
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_lp_connect_ind
LBB0_10:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERROR
Lloh18:
	adrp	x8, _HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hci_disconnect
Lloh21:
	adrp	x8, _HCI_CONN_TERMINATED_BY_LOCAL_HOST@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HCI_CONN_TERMINATED_BY_LOCAL_HOST@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_lp_disconnect_ind
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hci_conn_complete_evt(%p,%02x - %02x:%02x:%02x:%02x:%02x:%02x)\n"

l_.str.1:                               ; @.str.1
	.asciz	"hci_conn_complete_evt: Could not allocate memory for link. Disconnect\n"

	.comm	_HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES,4,2 ; @HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES
	.comm	_HCI_CONN_TERMINATED_BY_LOCAL_HOST,4,2 ; @HCI_CONN_TERMINATED_BY_LOCAL_HOST
	.comm	_hci_active_links,4,2           ; @hci_active_links
	.comm	_hci_dev,4,2                    ; @hci_dev
	.comm	_ERR_OK,4,2                     ; @ERR_OK
	.comm	_ERR_CONN,4,2                   ; @ERR_CONN
	.no_dead_strip	_hci_conn_complete_evt
.subsections_via_symbols
