	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sco_sock_connect
_sco_sock_connect:                      ## @sco_sock_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	(%rdi), %r12
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_BT_DBG
	cmpl	$4, %ebx
	jb	LBB0_2
## %bb.1:
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%r15)
	jne	LBB0_2
## %bb.4:
	movq	(%r12), %rax
	movq	_BT_OPEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.5:
	movq	_BT_BOUND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_EBADFD@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_7:
	movq	8(%r12), %rax
	movq	_SOCK_SEQPACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.8:
	movq	%r12, %rdi
	callq	_lock_sock
	movq	%r12, %rdi
	callq	_bt_sk
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_bacpy
	movq	%r12, %rdi
	callq	_sco_connect
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_sock_sndtimeo
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_bt_sock_wait_state
	movl	%eax, %ebx
LBB0_10:
	movq	%r12, %rdi
	callq	_release_sock
	jmp	LBB0_11
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sk %p"

	.comm	_AF_BLUETOOTH,8,3               ## @AF_BLUETOOTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BT_OPEN,8,3                    ## @BT_OPEN
	.comm	_BT_BOUND,8,3                   ## @BT_BOUND
	.comm	_EBADFD,4,2                     ## @EBADFD
	.comm	_SOCK_SEQPACKET,8,3             ## @SOCK_SEQPACKET
	.comm	_BT_CONNECTED,4,2               ## @BT_CONNECTED
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.no_dead_strip	_sco_sock_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sco_sock_connect
_sco_sock_connect:                      ; @sco_sock_connect
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x3
	mov	x22, x2
	mov	x21, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_DBG
	cmp	w22, #4
	b.lo	LBB0_7
; %bb.1:
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _AF_BLUETOOTH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _BT_OPEN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BT_OPEN@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x10, _BT_BOUND@GOTPAGE
Lloh9:
	ldr	x10, [x10, _BT_BOUND@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x19, #8]
Lloh11:
	adrp	x9, _SOCK_SEQPACKET@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SOCK_SEQPACKET@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_lock_sock
	mov	x0, x19
	bl	_bt_sk
	mov	x1, x21
	bl	_bacpy
	mov	x0, x19
	bl	_sco_connect
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.5:
Lloh14:
	adrp	x8, _BT_CONNECTED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BT_CONNECTED@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
Lloh17:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	and	w1, w8, w20
	mov	x0, x19
	bl	_sock_sndtimeo
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_bt_sock_wait_state
	mov	x21, x0
LBB0_6:
	mov	x0, x19
	bl	_release_sock
	b	LBB0_10
LBB0_7:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh22:
	adrp	x8, _EBADFD@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EBADFD@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sk %p"

	.comm	_AF_BLUETOOTH,8,3               ; @AF_BLUETOOTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BT_OPEN,8,3                    ; @BT_OPEN
	.comm	_BT_BOUND,8,3                   ; @BT_BOUND
	.comm	_EBADFD,4,2                     ; @EBADFD
	.comm	_SOCK_SEQPACKET,8,3             ; @SOCK_SEQPACKET
	.comm	_BT_CONNECTED,4,2               ; @BT_CONNECTED
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.no_dead_strip	_sco_sock_connect
.subsections_via_symbols
