	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function server_register
_server_register:                       ## @server_register
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	_server_ss@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_1
LBB0_3:
	leaq	-24(%rbp), %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movq	_l2cap_psm@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -16(%rbp)
	movq	_server_avail@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movq	_l2cap_mode@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpq	$0, (%rax)
	setne	%cl
	movl	%ecx, -24(%rbp)
	movq	_server_handle@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	(%rbx), %rdi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:
	leaq	-24(%rbp), %rdx
	movl	$12, %ecx
	callq	_sdp_change_service
	testl	%eax, %eax
	jne	LBB0_9
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	_control_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sdp_open_local
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %rdi
	callq	_sdp_error
	testq	%rax, %rax
	je	LBB0_3
LBB0_8:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_log_err                        ## TAILCALL
LBB0_5:
	movq	_service_class@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_local_bdaddr@GOTPCREL(%rip), %rdx
	movq	_server_handle@GOTPCREL(%rip), %r9
	leaq	-24(%rbp), %rcx
	movl	$12, %r8d
	callq	_sdp_register_service
	testl	%eax, %eax
	je	LBB0_7
LBB0_9:
	movq	(%rbx), %rdi
	callq	_sdp_error
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_service_name@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_err
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_server_ss,8,3                  ## @server_ss
	.comm	_control_path,4,2               ## @control_path
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to contact SDP server"

	.comm	_l2cap_psm,4,2                  ## @l2cap_psm
	.comm	_server_avail,4,2               ## @server_avail
	.comm	_l2cap_mode,8,3                 ## @l2cap_mode
	.comm	_server_handle,8,3              ## @server_handle
	.comm	_service_class,4,2              ## @service_class
	.comm	_local_bdaddr,4,2               ## @local_bdaddr
	.comm	_errno,8,3                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"%s: %m"

	.comm	_service_name,4,2               ## @service_name
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.no_dead_strip	_server_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function server_register
_server_register:                       ; @server_register
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
Lloh0:
	adrp	x19, _server_ss@GOTPAGE
Lloh1:
	ldr	x19, [x19, _server_ss@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_4
LBB0_1:
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #12
	bl	_memset
Lloh2:
	adrp	x8, _l2cap_psm@GOTPAGE
Lloh3:
	ldr	x8, [x8, _l2cap_psm@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh5:
	adrp	x8, _server_avail@GOTPAGE
Lloh6:
	ldr	x8, [x8, _server_avail@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _l2cap_mode@GOTPAGE
Lloh9:
	ldr	x9, [x9, _l2cap_mode@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, #0
	cset	w9, ne
	stp	w9, w8, [sp, #16]
Lloh11:
	adrp	x8, _server_handle@GOTPAGE
Lloh12:
	ldr	x8, [x8, _server_handle@GOTPAGEOFF]
Lloh13:
	ldr	x1, [x8]
	ldr	x0, [x19]
	cbz	x1, LBB0_7
; %bb.2:
	add	x2, sp, #16
	mov	w3, #12
	bl	_sdp_change_service
	cbnz	w0, LBB0_8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
Lloh14:
	adrp	x8, _control_path@GOTPAGE
Lloh15:
	ldr	x8, [x8, _control_path@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_sdp_open_local
	str	x0, [x19]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_sdp_error
	cbz	x0, LBB0_1
LBB0_6:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_log_err
LBB0_7:
Lloh19:
	adrp	x8, _service_class@GOTPAGE
Lloh20:
	ldr	x8, [x8, _service_class@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x2, _local_bdaddr@GOTPAGE
Lloh23:
	ldr	x2, [x2, _local_bdaddr@GOTPAGEOFF]
Lloh24:
	adrp	x5, _server_handle@GOTPAGE
Lloh25:
	ldr	x5, [x5, _server_handle@GOTPAGEOFF]
	add	x3, sp, #16
	mov	w4, #12
	bl	_sdp_register_service
	cbz	w0, LBB0_3
LBB0_8:
	ldr	x0, [x19]
	bl	_sdp_error
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh28:
	str	x0, [x8]
Lloh29:
	adrp	x8, _service_name@GOTPAGE
Lloh30:
	ldr	x8, [x8, _service_name@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_log_err
Lloh34:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_server_ss,8,3                  ; @server_ss
	.comm	_control_path,4,2               ; @control_path
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to contact SDP server"

	.comm	_l2cap_psm,4,2                  ; @l2cap_psm
	.comm	_server_avail,4,2               ; @server_avail
	.comm	_l2cap_mode,8,3                 ; @l2cap_mode
	.comm	_server_handle,8,3              ; @server_handle
	.comm	_service_class,4,2              ; @service_class
	.comm	_local_bdaddr,4,2               ; @local_bdaddr
	.comm	_errno,8,3                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"%s: %m"

	.comm	_service_name,4,2               ; @service_name
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.no_dead_strip	_server_register
.subsections_via_symbols
