	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_server_TcpOpen                 ## -- Begin function server_TcpOpen
	.p2align	4, 0x90
_server_TcpOpen:                        ## @server_TcpOpen
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_server@GOTPCREL(%rip), %rax
	cmpq	%rsi, 8(%rax)
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_server_Close
LBB0_2:
	testq	%r12, %r12
	je	LBB0_3
## %bb.4:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_probe@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_6
## %bb.5:
	movq	_AF_INET6@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	%r12, %rdi
	callq	_htons
	movq	%rax, -40(%rbp)
	movq	$4, -48(%rbp)
	movl	$24, %r15d
	movq	_PF_INET6@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movq	_SERVER_INVALID@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_6:
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	%r12, %rdi
	callq	_htons
	movq	_INADDR_ANY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	$32, %r15d
	movq	_PF_INET@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, -52(%rbp)
	testl	%eax, %eax
	js	LBB0_8
## %bb.11:
	movl	%eax, %ebx
	cmpq	$0, (%r13)
	je	LBB0_13
## %bb.12:
	movl	$0, -56(%rbp)
	movq	_IPPROTO_IPV6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPV6_V6ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rcx
	movl	$4, %r8d
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_setsockopt
LBB0_13:
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-52(%rbp), %rcx
	movl	$4, %r8d
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_setsockopt
	movl	-52(%rbp), %edi
	leaq	-48(%rbp), %rsi
	movl	%r15d, %edx
	callq	_bind
	testq	%rax, %rax
	js	LBB0_14
## %bb.16:
	movl	-52(%rbp), %edi
	movl	$5, %esi
	callq	_listen
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	_LogERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_15
LBB0_8:
	movq	_LogERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_log_Printf
	jmp	LBB0_9
LBB0_14:
	movq	_LogWARN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
LBB0_15:
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_log_Printf
	movl	-52(%rbp), %edi
	callq	_close
LBB0_9:
	movq	_server@GOTPCREL(%rip), %rdx
	movq	_SERVER_FAILED@GOTPCREL(%rip), %rax
	cmpl	$-1, (%rdx)
	jne	LBB0_19
## %bb.10:
	movl	$-1, (%rdx)
	movq	%r12, 8(%rdx)
	movq	16(%rdx), %rcx
	movb	$0, (%rcx)
	movq	$0, 24(%rdx)
	jmp	LBB0_19
LBB0_18:
	movq	%r14, %rdi
	callq	_server_Close
	movl	-52(%rbp), %eax
	movq	_server@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	%r12, 8(%rcx)
	movq	16(%rcx), %rax
	movb	$0, (%rax)
	movq	$0, 24(%rcx)
	movq	_LogPHASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdx
	callq	_log_Printf
	movq	_SERVER_OK@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_server,32,3                    ## @server
	.comm	_SERVER_INVALID,4,2             ## @SERVER_INVALID
	.comm	_probe,8,3                      ## @probe
	.comm	_AF_INET6,4,2                   ## @AF_INET6
	.comm	_PF_INET6,4,2                   ## @PF_INET6
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_INADDR_ANY,4,2                 ## @INADDR_ANY
	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_LogERROR,4,2                   ## @LogERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Tcp: socket: %s\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_IPPROTO_IPV6,4,2               ## @IPPROTO_IPV6
	.comm	_IPV6_V6ONLY,4,2                ## @IPV6_V6ONLY
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
	.comm	_LogWARN,4,2                    ## @LogWARN
L_.str.1:                               ## @.str.1
	.asciz	"Tcp: bind: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"Tcp: Unable to listen to socket: %s\n"

	.comm	_LogPHASE,4,2                   ## @LogPHASE
L_.str.3:                               ## @.str.3
	.asciz	"Listening at port %d.\n"

	.comm	_SERVER_OK,4,2                  ## @SERVER_OK
	.comm	_SERVER_FAILED,4,2              ## @SERVER_FAILED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_server_TcpOpen                 ; -- Begin function server_TcpOpen
	.p2align	2
_server_TcpOpen:                        ; @server_TcpOpen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x23, _server@GOTPAGE
Lloh1:
	ldr	x23, [x23, _server@GOTPAGEOFF]
	ldr	x8, [x23, #8]
	cmp	x8, x1
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_server_Close
LBB0_2:
	cbz	x19, LBB0_5
; %bb.3:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh2:
	adrp	x24, _probe@GOTPAGE
Lloh3:
	ldr	x24, [x24, _probe@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_6
; %bb.4:
Lloh4:
	adrp	x8, _AF_INET6@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AF_INET6@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	mov	x0, x19
	bl	_htons
	mov	w8, #4
	stp	x8, x0, [sp, #24]
	mov	w21, #24
Lloh7:
	adrp	x8, _PF_INET6@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PF_INET6@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _SERVER_INVALID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SERVER_INVALID@GOTPAGEOFF]
	b	LBB0_19
LBB0_6:
Lloh11:
	adrp	x8, _AF_INET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [sp, #48]
	mov	x0, x19
	bl	_htons
Lloh14:
	adrp	x8, _INADDR_ANY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _INADDR_ANY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	mov	w21, #32
Lloh17:
	adrp	x8, _PF_INET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
Lloh19:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	str	w0, [sp, #20]
	tbnz	w0, #31, LBB0_13
; %bb.8:
	mov	x22, x0
	ldr	x8, [x24]
	cbz	x8, LBB0_10
; %bb.9:
	str	wzr, [sp, #16]
Lloh22:
	adrp	x8, _IPPROTO_IPV6@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IPPROTO_IPV6@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _IPV6_V6ONLY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _IPV6_V6ONLY@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	w8, #4
	add	x9, sp, #16
	stp	x9, x8, [sp]
	mov	x0, x22
	bl	_setsockopt
LBB0_10:
Lloh28:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
Lloh31:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	w8, #4
	add	x9, sp, #20
	stp	x9, x8, [sp]
	mov	x0, x22
	bl	_setsockopt
	ldr	w0, [sp, #20]
	add	x1, sp, #24
	mov	x2, x21
	bl	_bind
	tbnz	x0, #63, LBB0_14
; %bb.11:
	ldr	w0, [sp, #20]
	mov	w1, #5
	bl	_listen
	cbz	x0, LBB0_20
; %bb.12:
Lloh34:
	adrp	x8, _LogERROR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _LogERROR@GOTPAGEOFF]
Lloh36:
	ldr	w20, [x8]
Lloh37:
	adrp	x8, _errno@GOTPAGE
Lloh38:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh40:
	adrp	x1, l_.str.2@PAGE
Lloh41:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh42:
	adrp	x8, _LogERROR@GOTPAGE
Lloh43:
	ldr	x8, [x8, _LogERROR@GOTPAGEOFF]
Lloh44:
	ldr	w20, [x8]
Lloh45:
	adrp	x8, _errno@GOTPAGE
Lloh46:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh48:
	adrp	x1, l_.str@PAGE
Lloh49:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_log_Printf
	b	LBB0_16
LBB0_14:
Lloh50:
	adrp	x8, _LogWARN@GOTPAGE
Lloh51:
	ldr	x8, [x8, _LogWARN@GOTPAGEOFF]
Lloh52:
	ldr	w20, [x8]
Lloh53:
	adrp	x8, _errno@GOTPAGE
Lloh54:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh55:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh56:
	adrp	x1, l_.str.1@PAGE
Lloh57:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_15:
	mov	x0, x20
	bl	_log_Printf
	ldr	w0, [sp, #20]
	bl	_close
LBB0_16:
	ldr	w8, [x23]
	cmn	w8, #1
	b.ne	LBB0_18
; %bb.17:
	str	w8, [x23]
	str	x19, [x23, #8]
	ldr	x8, [x23, #16]
	strb	wzr, [x8]
	str	xzr, [x23, #24]
LBB0_18:
Lloh58:
	adrp	x8, _SERVER_FAILED@GOTPAGE
Lloh59:
	ldr	x8, [x8, _SERVER_FAILED@GOTPAGEOFF]
LBB0_19:
	ldr	w0, [x8]
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_20:
	mov	x0, x20
	bl	_server_Close
	ldr	w8, [sp, #20]
	str	w8, [x23]
	str	x19, [x23, #8]
	ldr	x8, [x23, #16]
	strb	wzr, [x8]
	str	xzr, [x23, #24]
Lloh60:
	adrp	x8, _LogPHASE@GOTPAGE
Lloh61:
	ldr	x8, [x8, _LogPHASE@GOTPAGEOFF]
Lloh62:
	ldr	w0, [x8]
Lloh63:
	adrp	x1, l_.str.3@PAGE
Lloh64:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	_log_Printf
Lloh65:
	adrp	x8, _SERVER_OK@GOTPAGE
Lloh66:
	ldr	x8, [x8, _SERVER_OK@GOTPAGEOFF]
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpLdrGot	Lloh65, Lloh66
	.loh AdrpAdd	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.cfi_endproc
                                        ; -- End function
	.comm	_server,32,3                    ; @server
	.comm	_SERVER_INVALID,4,2             ; @SERVER_INVALID
	.comm	_probe,8,3                      ; @probe
	.comm	_AF_INET6,4,2                   ; @AF_INET6
	.comm	_PF_INET6,4,2                   ; @PF_INET6
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_INADDR_ANY,4,2                 ; @INADDR_ANY
	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_LogERROR,4,2                   ; @LogERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Tcp: socket: %s\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_IPPROTO_IPV6,4,2               ; @IPPROTO_IPV6
	.comm	_IPV6_V6ONLY,4,2                ; @IPV6_V6ONLY
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
	.comm	_LogWARN,4,2                    ; @LogWARN
l_.str.1:                               ; @.str.1
	.asciz	"Tcp: bind: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"Tcp: Unable to listen to socket: %s\n"

	.comm	_LogPHASE,4,2                   ; @LogPHASE
l_.str.3:                               ; @.str.3
	.asciz	"Listening at port %d.\n"

	.comm	_SERVER_OK,4,2                  ; @SERVER_OK
	.comm	_SERVER_FAILED,4,2              ; @SERVER_FAILED
.subsections_via_symbols
