	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sco_connect
_sco_connect:                           ## @sco_connect
	.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	%rdi, %r12
	callq	_bt_sk
	movq	%rax, %r14
	addq	$4, %r14
	movq	%r12, %rdi
	callq	_bt_sk
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_batostr
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_batostr
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_BT_DBG
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_hci_get_route
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_hci_dev_lock_bh
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	%r15, %rdi
	callq	_lmp_esco_capable
	movq	_disable_esco@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	movq	_SCO_LINK@GOTPCREL(%rip), %rcx
	movq	%rcx, %rdx
	jne	LBB0_4
## %bb.3:
	movq	_ESCO_LINK@GOTPCREL(%rip), %rdx
LBB0_4:
	testq	%rax, %rax
	cmoveq	%rcx, %rdx
	movl	(%rdx), %esi
	movq	_BT_SECURITY_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_HCI_AT_NO_BONDING@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_hci_connect
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movq	%rax, %r13
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_sco_conn_add
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rbx
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bacpy
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_sco_chan_add
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movq	(%r13), %rax
	movq	_BT_CONNECTED@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_10
## %bb.9:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_sco_sock_clear_timer
	movq	(%r14), %rax
	movq	%rax, 8(%rbx)
	jmp	LBB0_11
LBB0_1:
	movq	_EHOSTUNREACH@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_13
LBB0_6:
	movq	%r13, %rdi
	callq	_hci_conn_put
	jmp	LBB0_12
LBB0_10:
	movq	_BT_CONNECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 8(%rdi)
	movl	(%rdi), %esi
	callq	_sco_sock_set_timer
LBB0_11:
	xorl	%r12d, %r12d
LBB0_12:
	movq	%r15, %rdi
	callq	_hci_dev_unlock_bh
	movq	%r15, %rdi
	callq	_hci_dev_put
LBB0_13:
	movl	%r12d, %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	"%s -> %s"

	.comm	_EHOSTUNREACH,4,2               ## @EHOSTUNREACH
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_disable_esco,4,2               ## @disable_esco
	.comm	_ESCO_LINK,4,2                  ## @ESCO_LINK
	.comm	_SCO_LINK,4,2                   ## @SCO_LINK
	.comm	_BT_SECURITY_LOW,4,2            ## @BT_SECURITY_LOW
	.comm	_HCI_AT_NO_BONDING,4,2          ## @HCI_AT_NO_BONDING
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.comm	_BT_CONNECT,8,3                 ## @BT_CONNECT
	.no_dead_strip	_sco_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sco_connect
_sco_connect:                           ; @sco_connect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_bt_sk
	add	x21, x0, #4
	mov	x0, x19
	bl	_bt_sk
	mov	x23, x0
	mov	x0, x21
	bl	_batostr
	mov	x20, x0
	mov	x0, x23
	bl	_batostr
	mov	x2, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_BT_DBG
	mov	x0, x23
	mov	x1, x21
	bl	_hci_get_route
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
	bl	_hci_dev_lock_bh
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x20
	bl	_lmp_esco_capable
Lloh5:
	adrp	x8, _disable_esco@GOTPAGE
Lloh6:
	ldr	x8, [x8, _disable_esco@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, #0
	ccmp	x0, #0, #4, eq
Lloh8:
	adrp	x8, _SCO_LINK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SCO_LINK@GOTPAGEOFF]
Lloh10:
	adrp	x9, _ESCO_LINK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ESCO_LINK@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _BT_SECURITY_LOW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BT_SECURITY_LOW@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
Lloh15:
	adrp	x8, _HCI_AT_NO_BONDING@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HCI_AT_NO_BONDING@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_hci_connect
	cbz	x0, LBB0_9
; %bb.2:
	mov	x23, x0
	mov	w1, #0
	bl	_sco_conn_add
	cbz	x0, LBB0_7
; %bb.3:
	mov	x24, x0
	ldr	w1, [x0]
	mov	x0, x21
	bl	_bacpy
	mov	x0, x24
	mov	x1, x19
	mov	x2, #0
	bl	_sco_chan_add
	mov	x22, x0
	cbnz	w0, LBB0_9
; %bb.4:
	ldr	x8, [x23]
Lloh18:
	adrp	x21, _BT_CONNECTED@GOTPAGE
Lloh19:
	ldr	x21, [x21, _BT_CONNECTED@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_sco_sock_clear_timer
	mov	w22, #0
	ldr	x8, [x21]
	str	x8, [x19, #8]
	b	LBB0_9
LBB0_6:
Lloh20:
	adrp	x8, _EHOSTUNREACH@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EHOSTUNREACH@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_7:
	mov	x0, x23
	bl	_hci_conn_put
	b	LBB0_9
LBB0_8:
Lloh23:
	adrp	x8, _BT_CONNECT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BT_CONNECT@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	ldr	w1, [x19]
	mov	x0, x19
	bl	_sco_sock_set_timer
	mov	w22, #0
LBB0_9:
	mov	x0, x20
	bl	_hci_dev_unlock_bh
	mov	x0, x20
	bl	_hci_dev_put
LBB0_10:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s -> %s"

	.comm	_EHOSTUNREACH,4,2               ; @EHOSTUNREACH
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_disable_esco,4,2               ; @disable_esco
	.comm	_ESCO_LINK,4,2                  ; @ESCO_LINK
	.comm	_SCO_LINK,4,2                   ; @SCO_LINK
	.comm	_BT_SECURITY_LOW,4,2            ; @BT_SECURITY_LOW
	.comm	_HCI_AT_NO_BONDING,4,2          ; @HCI_AT_NO_BONDING
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.comm	_BT_CONNECT,8,3                 ; @BT_CONNECT
	.no_dead_strip	_sco_connect
.subsections_via_symbols
