	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ws_socket
_ws_socket:                             ## @ws_socket
	.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	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	$1, -28(%rbp)
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$20, %edx
	callq	_memset
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_wsconfig@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edi
	leaq	-24(%rbp), %rcx
	movq	%rbx, %rdx
	callq	_getaddrinfo
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gai_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_FATAL
LBB0_2:
	movq	-24(%rbp), %rax
	movl	16(%rax), %edi
	movl	8(%rax), %edx
	movl	12(%rax), %esi
	callq	_socket
	movl	%eax, (%r14)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-28(%rbp), %rcx
	movl	%eax, %edi
	movl	$4, %r8d
	callq	_setsockopt
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_FATAL
LBB0_4:
	movl	(%r14), %edi
	movq	-24(%rbp), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	callq	_bind
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_FATAL
LBB0_6:
	movq	-24(%rbp), %rdi
	callq	_freeaddrinfo
	movl	(%r14), %edi
	movq	_SOMAXCONN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_listen
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	callq	_FATAL
LBB0_8:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_UNSPEC,4,2                  ## @AF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_wsconfig,8,2                   ## @wsconfig
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to set server: %s."

	.comm	_errno,4,2                      ## @errno
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
L_.str.1:                               ## @.str.1
	.asciz	"Unable to set setsockopt: %s."

L_.str.2:                               ## @.str.2
	.asciz	"Unable to set bind: %s."

	.comm	_SOMAXCONN,4,2                  ## @SOMAXCONN
L_.str.3:                               ## @.str.3
	.asciz	"Unable to listen: %s."

	.no_dead_strip	_ws_socket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ws_socket
_ws_socket:                             ; @ws_socket
	.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
	mov	x19, x0
	mov	w8, #1
	stur	w8, [x29, #-20]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #20
	bl	_memset
Lloh0:
	adrp	x8, _AF_UNSPEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF_UNSPEC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SOCK_STREAM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SOCK_STREAM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #20]
Lloh6:
	adrp	x8, _wsconfig@GOTPAGE
Lloh7:
	ldr	x8, [x8, _wsconfig@GOTPAGEOFF]
	ldp	w1, w0, [x8]
	add	x2, sp, #8
	mov	x3, sp
	bl	_getaddrinfo
Lloh8:
	adrp	x20, _errno@GOTPAGE
Lloh9:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x20]
	bl	_gai_strerror
	mov	x1, x0
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FATAL
LBB0_2:
	ldr	x8, [sp]
	ldp	w1, w0, [x8, #12]
	ldr	w2, [x8, #8]
	bl	_socket
	str	w0, [x19]
Lloh12:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	sub	x3, x29, #20
	mov	w4, #4
	bl	_setsockopt
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x20]
	bl	_strerror
	mov	x1, x0
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_FATAL
LBB0_4:
	ldr	w0, [x19]
	ldr	x8, [sp]
	ldp	w2, w1, [x8]
	bl	_bind
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w0, [x20]
	bl	_strerror
	mov	x1, x0
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_FATAL
LBB0_6:
	ldr	x0, [sp]
	bl	_freeaddrinfo
	ldr	w0, [x19]
Lloh22:
	adrp	x8, _SOMAXCONN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SOMAXCONN@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	bl	_listen
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
	ldr	w0, [x20]
	bl	_strerror
	mov	x1, x0
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_FATAL
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_UNSPEC,4,2                  ; @AF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_wsconfig,8,2                   ; @wsconfig
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to set server: %s."

	.comm	_errno,4,2                      ; @errno
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
l_.str.1:                               ; @.str.1
	.asciz	"Unable to set setsockopt: %s."

l_.str.2:                               ; @.str.2
	.asciz	"Unable to set bind: %s."

	.comm	_SOMAXCONN,4,2                  ; @SOMAXCONN
l_.str.3:                               ; @.str.3
	.asciz	"Unable to listen: %s."

	.no_dead_strip	_ws_socket
.subsections_via_symbols
