	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rfcomm_channel_lookup          ## -- Begin function rfcomm_channel_lookup
	.p2align	4, 0x90
_rfcomm_channel_lookup:                 ## @rfcomm_channel_lookup
	.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
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	shlq	$2, %r14
	movq	%r14, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	%ebx, -52(%rbp)
	movq	_SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %esi
	callq	_SDP_ATTR_RANGE
	movq	%rax, -136(%rbp)
	movq	_SDP_ATTR_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%r14, -112(%rbp)
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, -104(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -96(%rbp)
	testq	%r13, %r13
	jne	LBB0_2
## %bb.1:
	movq	_NG_HCI_BDADDR_ANY@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
LBB0_2:
	testq	%r12, %r12
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_4
## %bb.3:
	testq	%r14, %r14
	jne	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_5:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_sdp_open
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_7:
	movq	%rbx, %rdi
	callq	_sdp_error
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_sdp_error
	movq	%rax, %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_9:
	subq	$8, %rsp
	leaq	-128(%rbp), %rax
	leaq	-52(%rbp), %rdx
	leaq	-136(%rbp), %r8
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	movl	$1, %r9d
	pushq	%rax
	callq	_sdp_search
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_sdp_error
	movq	%rax, %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_11:
	movq	-120(%rbp), %rax
	movq	_SDP_ATTR_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.12:
	movq	_ENOATTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_13:
	movq	%rbx, %rdi
	callq	_sdp_close
	movq	-112(%rbp), %rax
	movq	_PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jge	LBB0_15
## %bb.14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_15:
	movl	-104(%rbp), %esi
	callq	_SDP_GET8
	movl	-104(%rbp), %esi
	xorl	%edi, %edi
	callq	_SDP_GET8
	cmpq	$0, (%rbx)
	jle	LBB0_17
## %bb.16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_rfcomm_channel_lookup_exit
LBB0_17:
	movl	-104(%rbp), %edi
	movq	-112(%rbp), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movq	%r14, %rdx
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	callq	_rfcomm_proto_list_parse
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_19
## %bb.18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE,4,2 ## @PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE
	.comm	_SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST,4,2 ## @SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST
	.comm	_SDP_ATTR_INVALID,4,2           ## @SDP_ATTR_INVALID
	.comm	_NG_HCI_BDADDR_ANY,8,3          ## @NG_HCI_BDADDR_ANY
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_ENOMEM,8,3                     ## @ENOMEM
	.comm	_SDP_ATTR_OK,8,3                ## @SDP_ATTR_OK
	.comm	_ENOATTR,8,3                    ## @ENOATTR
	.comm	_PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE,8,3 ## @PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE
	.comm	_SDP_DATA_ALT8,8,3              ## @SDP_DATA_ALT8
	.comm	_SDP_DATA_ALT16,8,3             ## @SDP_DATA_ALT16
	.comm	_SDP_DATA_ALT32,8,3             ## @SDP_DATA_ALT32
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rfcomm_channel_lookup          ; -- Begin function rfcomm_channel_lookup
	.p2align	2
_rfcomm_channel_lookup:                 ; @rfcomm_channel_lookup
	.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
	sub	sp, sp, #80
	mov	x19, x4
	mov	x20, x3
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x23, x8, #2
	mov	x9, x23
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x23, #15
	and	x9, x9, #0x7fffffff0
	sub	x24, x8, x9
	mov	sp, x24
	stur	w2, [x29, #-60]
Lloh8:
	adrp	x8, _SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x0
	bl	_SDP_ATTR_RANGE
	stur	x0, [x29, #-72]
Lloh11:
	adrp	x8, _SDP_ATTR_INVALID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SDP_ATTR_INVALID@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	stur	w8, [x29, #-120]
	stp	xzr, x23, [x29, #-112]
	stur	w24, [x29, #-96]
Lloh14:
	adrp	x8, _NG_HCI_BDADDR_ANY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NG_HCI_BDADDR_ANY@GOTPAGEOFF]
	stp	xzr, xzr, [x29, #-88]
Lloh16:
	ldr	x8, [x8]
	cmp	x22, #0
	csel	x22, x8, x22, eq
Lloh17:
	adrp	x23, _EINVAL@GOTPAGE
Lloh18:
	ldr	x23, [x23, _EINVAL@GOTPAGEOFF]
	cbz	x21, LBB0_2
; %bb.1:
	cbnz	x20, LBB0_3
LBB0_2:
	ldr	x0, [x23]
	bl	_rfcomm_channel_lookup_exit
LBB0_3:
	mov	x0, x22
	mov	x1, x21
	bl	_sdp_open
	mov	x21, x0
	cbnz	x0, LBB0_5
; %bb.4:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	x0, [x8]
	bl	_rfcomm_channel_lookup_exit
LBB0_5:
	mov	x0, x21
	bl	_sdp_error
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_sdp_error
	bl	_rfcomm_channel_lookup_exit
LBB0_7:
	sub	x2, x29, #60
	sub	x4, x29, #72
	sub	x6, x29, #120
	mov	x0, x21
	mov	w1, #1
	mov	w3, #1
	mov	w5, #1
	bl	_sdp_search
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_sdp_error
	bl	_rfcomm_channel_lookup_exit
LBB0_9:
	ldur	x8, [x29, #-112]
Lloh22:
	adrp	x9, _SDP_ATTR_OK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SDP_ATTR_OK@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
Lloh25:
	adrp	x8, _ENOATTR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOATTR@GOTPAGEOFF]
Lloh27:
	ldr	x0, [x8]
	bl	_rfcomm_channel_lookup_exit
LBB0_11:
	mov	x0, x21
	bl	_sdp_close
	ldur	x8, [x29, #-104]
Lloh28:
	adrp	x21, _PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE@GOTPAGE
Lloh29:
	ldr	x21, [x21, _PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ge	LBB0_13
; %bb.12:
	ldr	x0, [x23]
	bl	_rfcomm_channel_lookup_exit
LBB0_13:
	ldur	w1, [x29, #-96]
	bl	_SDP_GET8
	ldur	w1, [x29, #-96]
	mov	x0, #0
	bl	_SDP_GET8
	ldr	x8, [x21]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.14:
	ldr	x0, [x23]
	bl	_rfcomm_channel_lookup_exit
LBB0_15:
	ldur	w0, [x29, #-96]
	ldur	x8, [x29, #-104]
	add	x1, x24, x8, lsl #2
	mov	x2, x20
	mov	x3, x19
	bl	_rfcomm_proto_list_parse
	ldur	x8, [x29, #-56]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	sub	sp, x29, #48
	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
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE,4,2 ; @PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE
	.comm	_SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST,4,2 ; @SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST
	.comm	_SDP_ATTR_INVALID,4,2           ; @SDP_ATTR_INVALID
	.comm	_NG_HCI_BDADDR_ANY,8,3          ; @NG_HCI_BDADDR_ANY
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_ENOMEM,8,3                     ; @ENOMEM
	.comm	_SDP_ATTR_OK,8,3                ; @SDP_ATTR_OK
	.comm	_ENOATTR,8,3                    ; @ENOATTR
	.comm	_PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE,8,3 ; @PROTOCOL_DESCRIPTOR_LIST_MINIMAL_SIZE
	.comm	_SDP_DATA_ALT8,8,3              ; @SDP_DATA_ALT8
	.comm	_SDP_DATA_ALT16,8,3             ; @SDP_DATA_ALT16
	.comm	_SDP_DATA_ALT32,8,3             ; @SDP_DATA_ALT32
.subsections_via_symbols
