	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lp_connect_req                 ## -- Begin function lp_connect_req
	.p2align	4, 0x90
_lp_connect_req:                        ## @lp_connect_req
	.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, %r12d
	movq	%rdi, %r13
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_hci_new
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_bd_addr_set
	movq	_hci_active_links@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_HCI_REG
	movq	_hci_dev@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_8
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	12(%rbx), %rdi
	movq	%r13, %rsi
	callq	_bd_addr_cmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_5
LBB0_8:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r14d, %r14d
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_6:
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%rbx), %r14d
	movl	8(%rbx), %r15d
LBB0_9:
	movq	_PBUF_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_HCI_CREATE_CONN_PLEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_PBUF_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_btpbuf_alloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	_HCI_CREATE_CONN_OCF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_HCI_LINK_CTRL_OGF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%rbx), %ecx
	movq	%rax, %rdi
	callq	_hci_cmd_ass
	movl	%r12d, %ebx
	movq	%rax, %r12
	movq	8(%rax), %rdi
	addq	$16, %rdi
	movl	(%r13), %esi
	movl	$6, %edx
	callq	_memcpy
	movq	_hci_dev@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_htole16
	movq	8(%r12), %rcx
	movl	%eax, 20(%rcx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 48(%rcx)
	movl	%r14d, 52(%rcx)
	movl	%r15d, %edi
	callq	_htole16
	movq	8(%r12), %rcx
	movl	%eax, 28(%rcx)
	movl	%ebx, 64(%rcx)
	movl	(%r12), %esi
	movq	%r12, %rdi
	callq	_physbusif_output
	movq	%r12, %rdi
	callq	_btpbuf_free
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	callq	_ERROR
	movq	_ERR_MEM@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	addq	$8, %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	"lp_connect_req: Could not allocate memory for link\n"

	.comm	_ERR_MEM,4,2                    ## @ERR_MEM
	.comm	_hci_active_links,4,2           ## @hci_active_links
	.comm	_hci_dev,8,3                    ## @hci_dev
	.comm	_PBUF_RAW,4,2                   ## @PBUF_RAW
	.comm	_HCI_CREATE_CONN_PLEN,4,2       ## @HCI_CREATE_CONN_PLEN
	.comm	_PBUF_RAM,4,2                   ## @PBUF_RAM
L_.str.1:                               ## @.str.1
	.asciz	"lp_connect_req: Could not allocate memory for pbuf\n"

	.comm	_HCI_CREATE_CONN_OCF,4,2        ## @HCI_CREATE_CONN_OCF
	.comm	_HCI_LINK_CTRL_OGF,4,2          ## @HCI_LINK_CTRL_OGF
	.comm	_ERR_OK,4,2                     ## @ERR_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function lp_connect_req
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_lp_connect_req
	.p2align	2
_lp_connect_req:                        ; @lp_connect_req
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-80]!             ; 16-byte Folded Spill
	.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
	.cfi_offset b8, -72
	.cfi_offset b9, -80
	mov	x19, x1
	mov	x20, x0
	bl	_hci_new
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	mov	x1, x20
	bl	_bd_addr_set
Lloh0:
	adrp	x0, _hci_active_links@GOTPAGE
Lloh1:
	ldr	x0, [x0, _hci_active_links@GOTPAGEOFF]
	mov	x1, x21
	bl	_HCI_REG
Lloh2:
	adrp	x23, _hci_dev@GOTPAGE
Lloh3:
	ldr	x23, [x23, _hci_dev@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	x21, [x8, #8]
Lloh4:
	adrp	x8, lCPI0_0@PAGE
Lloh5:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	cbz	x21, LBB0_6
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x21, #12
	mov	x1, x20
	bl	_bd_addr_cmp
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x21, [x21, #16]
	cbnz	x21, LBB0_2
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_5:
	ldr	d8, [x21]
	ldr	w21, [x21, #8]
LBB0_6:
Lloh8:
	adrp	x8, _PBUF_RAW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PBUF_RAW@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x22, _HCI_CREATE_CONN_PLEN@GOTPAGE
Lloh12:
	ldr	x22, [x22, _HCI_CREATE_CONN_PLEN@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh13:
	adrp	x8, _PBUF_RAM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PBUF_RAM@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	bl	_btpbuf_alloc
	cbz	x0, LBB0_8
; %bb.7:
Lloh16:
	adrp	x8, _HCI_CREATE_CONN_OCF@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HCI_CREATE_CONN_OCF@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x8, _HCI_LINK_CTRL_OGF@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HCI_LINK_CTRL_OGF@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	ldr	w3, [x22]
	bl	_hci_cmd_ass
	mov	x22, x0
	ldr	x8, [x0, #8]
	add	x0, x8, #16
	ldr	w1, [x20]
	mov	w2, #6
	bl	_memcpy
	ldr	x8, [x23]
	ldr	w0, [x8]
	bl	_htole16
	ldr	x8, [x22, #8]
	str	w0, [x8, #20]
	str	d8, [x8, #48]
	mov	x0, x21
	bl	_htole16
	ldr	x8, [x22, #8]
	str	w0, [x8, #28]
	str	w19, [x8, #64]
	ldr	w1, [x22]
	mov	x0, x22
	bl	_physbusif_output
	mov	x0, x22
	bl	_btpbuf_free
Lloh22:
	adrp	x8, _ERR_OK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ERR_OK@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_ERROR
Lloh26:
	adrp	x8, _ERR_MEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERR_MEM@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	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
	ldp	d9, d8, [sp], #80               ; 16-byte Folded Reload
	ret
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lp_connect_req: Could not allocate memory for link\n"

	.comm	_ERR_MEM,4,2                    ; @ERR_MEM
	.comm	_hci_active_links,4,2           ; @hci_active_links
	.comm	_hci_dev,8,3                    ; @hci_dev
	.comm	_PBUF_RAW,4,2                   ; @PBUF_RAW
	.comm	_HCI_CREATE_CONN_PLEN,4,2       ; @HCI_CREATE_CONN_PLEN
	.comm	_PBUF_RAM,4,2                   ; @PBUF_RAM
l_.str.1:                               ; @.str.1
	.asciz	"lp_connect_req: Could not allocate memory for pbuf\n"

	.comm	_HCI_CREATE_CONN_OCF,4,2        ; @HCI_CREATE_CONN_OCF
	.comm	_HCI_LINK_CTRL_OGF,4,2          ; @HCI_LINK_CTRL_OGF
	.comm	_ERR_OK,4,2                     ; @ERR_OK
.subsections_via_symbols
