	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function server_open
_server_open:                           ## @server_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_PF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_SEQPACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BLUETOOTH_PROTO_L2CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_socket
	movq	_server_fd@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.4:
	leaq	-56(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movl	$32, -56(%rbp)
	movq	_l2cap_psm@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htole16
	movl	%eax, -36(%rbp)
	movq	_BDADDR_BREDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	$0, -48(%rbp)
	leaq	-52(%rbp), %rdi
	movq	_local_bdaddr@GOTPCREL(%rip), %rsi
	callq	_bdaddr_copy
	movl	(%rbx), %edi
	movq	%r14, %rsi
	movl	$32, %edx
	callq	_bind
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.6:
	movq	_BNEP_MTU_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movl	(%rbx), %edi
	movq	_SOL_L2CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_L2CAP_IMTU@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-20(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_listen
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.10:
	movl	(%rbx), %esi
	movq	_EV_READ@GOTPCREL(%rip), %rax
	movq	_EV_PERSIST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_server_read@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_server_ev@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_event_set
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_event_add
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.5(%rip), %rdi
	callq	_log_info
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_7:
	movl	-20(%rbp), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_err
	jmp	LBB0_3
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_2
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_log_err
LBB0_3:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_BLUETOOTH,4,2               ## @PF_BLUETOOTH
	.comm	_SOCK_SEQPACKET,4,2             ## @SOCK_SEQPACKET
	.comm	_BLUETOOTH_PROTO_L2CAP,4,2      ## @BLUETOOTH_PROTO_L2CAP
	.comm	_server_fd,4,2                  ## @server_fd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open L2CAP socket: %m"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.comm	_AF_BLUETOOTH,4,2               ## @AF_BLUETOOTH
	.comm	_l2cap_psm,4,2                  ## @l2cap_psm
	.comm	_BDADDR_BREDR,4,2               ## @BDADDR_BREDR
	.comm	_local_bdaddr,4,2               ## @local_bdaddr
L_.str.1:                               ## @.str.1
	.asciz	"Could not bind server socket: %m"

	.comm	_BNEP_MTU_MIN,4,2               ## @BNEP_MTU_MIN
	.comm	_SOL_L2CAP,4,2                  ## @SOL_L2CAP
	.comm	_SO_L2CAP_IMTU,4,2              ## @SO_L2CAP_IMTU
L_.str.2:                               ## @.str.2
	.asciz	"Could not set L2CAP IMTU (%d): %m"

L_.str.3:                               ## @.str.3
	.asciz	"Could not listen on server socket: %m"

	.comm	_server_ev,4,2                  ## @server_ev
	.comm	_EV_READ,4,2                    ## @EV_READ
	.comm	_EV_PERSIST,4,2                 ## @EV_PERSIST
	.comm	_server_read,4,2                ## @server_read
L_.str.4:                               ## @.str.4
	.asciz	"Could not add server event: %m"

L_.str.5:                               ## @.str.5
	.asciz	"server socket open"

	.no_dead_strip	_server_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function server_open
_server_open:                           ; @server_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _PF_BLUETOOTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_BLUETOOTH@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SOCK_SEQPACKET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOCK_SEQPACKET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _BLUETOOTH_PROTO_L2CAP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BLUETOOTH_PROTO_L2CAP@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_socket
Lloh9:
	adrp	x19, _server_fd@GOTPAGE
Lloh10:
	ldr	x19, [x19, _server_fd@GOTPAGEOFF]
	str	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.1:
	add	x20, sp, #16
	mov	w21, #32
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh11:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	str	w21, [sp, #16]
Lloh14:
	adrp	x8, _l2cap_psm@GOTPAGE
Lloh15:
	ldr	x8, [x8, _l2cap_psm@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_htole16
Lloh17:
	adrp	x8, _BDADDR_BREDR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BDADDR_BREDR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	stp	w8, w0, [sp, #32]
	str	xzr, [sp, #24]
	orr	x0, x20, #0x4
Lloh20:
	adrp	x1, _local_bdaddr@GOTPAGE
Lloh21:
	ldr	x1, [x1, _local_bdaddr@GOTPAGEOFF]
	bl	_bdaddr_copy
	ldr	w0, [x19]
	add	x1, sp, #16
	mov	w2, #32
	bl	_bind
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:
Lloh22:
	adrp	x8, _BNEP_MTU_MIN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BNEP_MTU_MIN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldr	w0, [x19]
Lloh25:
	adrp	x8, _SOL_L2CAP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SOL_L2CAP@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _SO_L2CAP_IMTU@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SO_L2CAP_IMTU@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #4
	bl	_setsockopt
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.3:
	ldr	w0, [x19]
	mov	w1, #0
	bl	_listen
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.4:
	ldr	w1, [x19]
Lloh31:
	adrp	x8, _EV_READ@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EV_READ@GOTPAGEOFF]
Lloh33:
	adrp	x9, _EV_PERSIST@GOTPAGE
Lloh34:
	ldr	x9, [x9, _EV_PERSIST@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh37:
	adrp	x8, _server_read@GOTPAGE
Lloh38:
	ldr	x8, [x8, _server_read@GOTPAGEOFF]
Lloh39:
	ldr	w3, [x8]
Lloh40:
	adrp	x19, _server_ev@GOTPAGE
Lloh41:
	ldr	x19, [x19, _server_ev@GOTPAGEOFF]
	mov	x0, x19
	mov	x4, #0
	bl	_event_set
	mov	x0, x19
	mov	x1, #0
	bl	_event_add
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.5:
Lloh42:
	adrp	x0, l_.str.5@PAGE
Lloh43:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_log_info
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
Lloh44:
	adrp	x0, l_.str@PAGE
Lloh45:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_7:
Lloh46:
	adrp	x0, l_.str.1@PAGE
Lloh47:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_8:
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh48:
	adrp	x0, l_.str.2@PAGE
Lloh49:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_9:
Lloh50:
	adrp	x0, l_.str.3@PAGE
Lloh51:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh52:
	adrp	x0, l_.str.4@PAGE
Lloh53:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_11:
	bl	_log_err
Lloh54:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh55:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh56:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh35
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_BLUETOOTH,4,2               ; @PF_BLUETOOTH
	.comm	_SOCK_SEQPACKET,4,2             ; @SOCK_SEQPACKET
	.comm	_BLUETOOTH_PROTO_L2CAP,4,2      ; @BLUETOOTH_PROTO_L2CAP
	.comm	_server_fd,4,2                  ; @server_fd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open L2CAP socket: %m"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.comm	_AF_BLUETOOTH,4,2               ; @AF_BLUETOOTH
	.comm	_l2cap_psm,4,2                  ; @l2cap_psm
	.comm	_BDADDR_BREDR,4,2               ; @BDADDR_BREDR
	.comm	_local_bdaddr,4,2               ; @local_bdaddr
l_.str.1:                               ; @.str.1
	.asciz	"Could not bind server socket: %m"

	.comm	_BNEP_MTU_MIN,4,2               ; @BNEP_MTU_MIN
	.comm	_SOL_L2CAP,4,2                  ; @SOL_L2CAP
	.comm	_SO_L2CAP_IMTU,4,2              ; @SO_L2CAP_IMTU
l_.str.2:                               ; @.str.2
	.asciz	"Could not set L2CAP IMTU (%d): %m"

l_.str.3:                               ; @.str.3
	.asciz	"Could not listen on server socket: %m"

	.comm	_server_ev,4,2                  ; @server_ev
	.comm	_EV_READ,4,2                    ; @EV_READ
	.comm	_EV_PERSIST,4,2                 ; @EV_PERSIST
	.comm	_server_read,4,2                ; @server_read
l_.str.4:                               ; @.str.4
	.asciz	"Could not add server event: %m"

l_.str.5:                               ; @.str.5
	.asciz	"server socket open"

	.no_dead_strip	_server_open
.subsections_via_symbols
