	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_server
_tcp_server:                            ## @tcp_server
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_TCP_SIDE_SERVER_LISTEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_tcp_setup_new
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movl	$1, -36(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edi
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-36(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	movq	-32(%rbp), %rax
	movq	8(%rax), %rax
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_PJDLOG_ASSERT
	movq	-32(%rbp), %rbx
	movl	(%rbx), %r15d
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_sockaddr_len
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_bind
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.3:
	movq	-32(%rbp), %rax
	movl	(%rax), %edi
	movl	$8, %esi
	callq	_listen
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.4:
	movq	-32(%rbp), %rax
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-32(%rbp), %rdi
	callq	_tcp_close
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TCP_SIDE_SERVER_LISTEN,4,2     ## @TCP_SIDE_SERVER_LISTEN
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
	.comm	_AF_UNSPEC,8,3                  ## @AF_UNSPEC
	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_tcp_server
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_server
_tcp_server:                            ; @tcp_server
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
Lloh0:
	adrp	x8, _TCP_SIDE_SERVER_LISTEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TCP_SIDE_SERVER_LISTEN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_tcp_setup_new
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.1:
	mov	w8, #1
	str	w8, [sp, #4]
	ldr	x8, [sp, #8]
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x3, sp, #4
	mov	w4, #4
	bl	_setsockopt
	ldr	x8, [sp, #8]
	ldr	x8, [x8, #8]
Lloh9:
	adrp	x9, _AF_UNSPEC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AF_UNSPEC@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	ldr	x20, [sp, #8]
	ldr	w21, [x20], #8
	mov	x0, x20
	bl	_sockaddr_len
	mov	x2, x0
	mov	x0, x21
	mov	x1, x20
	bl	_bind
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.2:
	ldr	x8, [sp, #8]
	ldr	w0, [x8]
	mov	w1, #8
	bl	_listen
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.3:
	mov	w20, #0
	ldr	x8, [sp, #8]
	str	x8, [x19]
	b	LBB0_5
LBB0_4:
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh14:
	ldr	w20, [x8]
	ldr	x0, [sp, #8]
	bl	_tcp_close
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_TCP_SIDE_SERVER_LISTEN,4,2     ; @TCP_SIDE_SERVER_LISTEN
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
	.comm	_AF_UNSPEC,8,3                  ; @AF_UNSPEC
	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_tcp_server
.subsections_via_symbols
