	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rfcomm_sock_bind
_rfcomm_sock_bind:                      ## @rfcomm_sock_bind
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	(%rdi), %r14
	leaq	8(%rsi), %r15
	movq	%r15, %rdi
	callq	_batostr
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_BT_DBG
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	callq	_lock_sock
	movq	(%r14), %rax
	movq	_BT_OPEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.6:
	movq	8(%r14), %rax
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	movq	_rfcomm_sk_list@GOTPCREL(%rip), %rdi
	callq	_write_lock_bh
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.9:
	movq	%r15, %rsi
	callq	___rfcomm_get_sock_by_addr
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_EADDRINUSE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_4:
	movq	_EBADFD@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_11:
	movq	%r14, %rdi
	callq	_bt_sk
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_bacpy
	movq	(%rbx), %rbx
	movq	%r14, %rdi
	callq	_rfcomm_pi
	movq	%rbx, (%rax)
	movq	_BT_BOUND@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
LBB0_12:
	movq	_rfcomm_sk_list@GOTPCREL(%rip), %rdi
	callq	_write_unlock_bh
LBB0_13:
	movq	%r14, %rdi
	callq	_release_sock
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sk %p %s"

	.comm	_AF_BLUETOOTH,8,3               ## @AF_BLUETOOTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BT_OPEN,8,3                    ## @BT_OPEN
	.comm	_EBADFD,4,2                     ## @EBADFD
	.comm	_SOCK_STREAM,8,3                ## @SOCK_STREAM
	.comm	_rfcomm_sk_list,4,2             ## @rfcomm_sk_list
	.comm	_EADDRINUSE,4,2                 ## @EADDRINUSE
	.comm	_BT_BOUND,8,3                   ## @BT_BOUND
	.no_dead_strip	_rfcomm_sock_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rfcomm_sock_bind
_rfcomm_sock_bind:                      ; @rfcomm_sock_bind
	.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, x1
	ldr	x19, [x0]
	add	x21, x1, #8
	mov	x0, x21
	bl	_batostr
	mov	x2, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_DBG
	cbz	x20, LBB0_7
; %bb.1:
	ldr	x8, [x20]
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:
	mov	x0, x19
	bl	_lock_sock
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _BT_OPEN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BT_OPEN@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x19, #8]
Lloh8:
	adrp	x9, _SOCK_STREAM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SOCK_STREAM@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.4:
Lloh11:
	adrp	x0, _rfcomm_sk_list@GOTPAGE
Lloh12:
	ldr	x0, [x0, _rfcomm_sk_list@GOTPAGEOFF]
	bl	_write_lock_bh
	ldr	x0, [x20]
	cbz	x0, LBB0_11
; %bb.5:
	mov	x1, x21
	bl	___rfcomm_get_sock_by_addr
	cbz	x0, LBB0_11
; %bb.6:
Lloh13:
	adrp	x8, _EADDRINUSE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EADDRINUSE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_7:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_8:
Lloh19:
	adrp	x8, _EBADFD@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EBADFD@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_11:
	mov	x0, x19
	bl	_bt_sk
	mov	x1, x21
	bl	_bacpy
	ldr	x21, [x20]
	mov	x0, x19
	bl	_rfcomm_pi
	mov	w20, #0
	str	x21, [x0]
Lloh23:
	adrp	x8, _BT_BOUND@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BT_BOUND@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_12:
Lloh26:
	adrp	x0, _rfcomm_sk_list@GOTPAGE
Lloh27:
	ldr	x0, [x0, _rfcomm_sk_list@GOTPAGEOFF]
	bl	_write_unlock_bh
LBB0_13:
	mov	x0, x19
	bl	_release_sock
LBB0_14:
	mov	x0, x20
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sk %p %s"

	.comm	_AF_BLUETOOTH,8,3               ; @AF_BLUETOOTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BT_OPEN,8,3                    ; @BT_OPEN
	.comm	_EBADFD,4,2                     ; @EBADFD
	.comm	_SOCK_STREAM,8,3                ; @SOCK_STREAM
	.comm	_rfcomm_sk_list,4,2             ; @rfcomm_sk_list
	.comm	_EADDRINUSE,4,2                 ; @EADDRINUSE
	.comm	_BT_BOUND,8,3                   ; @BT_BOUND
	.no_dead_strip	_rfcomm_sock_bind
.subsections_via_symbols
