	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_setup_new
_tcp_setup_new:                         ## @tcp_setup_new
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r12
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	callq	_PJDLOG_ASSERT
	movq	_TCP_SIDE_CLIENT@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	sete	%al
	movq	_TCP_SIDE_SERVER_LISTEN@GOTPCREL(%rip), %rcx
	cmpl	%r15d, (%rcx)
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_PJDLOG_ASSERT
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_PJDLOG_ASSERT
	movl	$24, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	leaq	L_.str(%rip), %rdi
	callq	_proto_get
	movl	%eax, %edi
	callq	_atoi
	movq	%r13, %rdx
	addq	$16, %rdx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_tcp_addr
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
LBB0_4:
	movq	%r13, %rdi
	callq	_free
	jmp	LBB0_10
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_5:
	movq	16(%r13), %rax
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	setne	%dil
	callq	_PJDLOG_ASSERT
	movq	16(%r13), %rdi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, (%r13)
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.7:
	movq	16(%r13), %rax
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	setne	%dil
	callq	_PJDLOG_ASSERT
	movl	$1, -44(%rbp)
	movl	(%r13), %edi
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TCP_NODELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.8:
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_pjdlog_errno
LBB0_9:
	xorl	%eax, %eax
	movq	_TCP_SIDE_CLIENT@GOTPCREL(%rip), %rcx
	cmpl	%r15d, (%rcx)
	setne	%al
	movl	%eax, 4(%r13)
	movl	%r15d, 8(%r13)
	movq	_TCP_CTX_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r13)
	movq	%r13, (%r14)
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_TCP_SIDE_CLIENT,4,2            ## @TCP_SIDE_CLIENT
	.comm	_TCP_SIDE_SERVER_LISTEN,4,2     ## @TCP_SIDE_SERVER_LISTEN
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp:port"

	.comm	_AF_UNSPEC,8,3                  ## @AF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.comm	_TCP_NODELAY,4,2                ## @TCP_NODELAY
	.comm	_LOG_WARNING,4,2                ## @LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"Unable to set TCP_NOELAY"

	.comm	_TCP_CTX_MAGIC,4,2              ## @TCP_CTX_MAGIC
	.no_dead_strip	_tcp_setup_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_setup_new
_tcp_setup_new:                         ; @tcp_setup_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x20, x1
	mov	x22, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_PJDLOG_ASSERT
Lloh0:
	adrp	x23, _TCP_SIDE_CLIENT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _TCP_SIDE_CLIENT@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, w20
Lloh2:
	adrp	x8, _TCP_SIDE_SERVER_LISTEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TCP_SIDE_SERVER_LISTEN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ccmp	w8, w20, #4, ne
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	cmp	x19, #0
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	mov	w0, #24
	bl	_malloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_proto_get
	bl	_atoi
	mov	x1, x0
	add	x2, x21, #16
	mov	x0, x22
	bl	_tcp_addr
	cbz	w0, LBB0_5
; %bb.2:
	mov	x22, x0
LBB0_3:
	mov	x0, x21
	bl	_free
	b	LBB0_9
LBB0_4:
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	w22, [x8]
	b	LBB0_9
LBB0_5:
	ldr	x8, [x21, #16]
Lloh10:
	adrp	x22, _AF_UNSPEC@GOTPAGE
Lloh11:
	ldr	x22, [x22, _AF_UNSPEC@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	ldr	x0, [x21, #16]
Lloh12:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	str	w0, [x21]
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.6:
	ldr	x8, [x21, #16]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	mov	w8, #1
	str	w8, [sp, #12]
	ldr	w0, [x21]
Lloh15:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _TCP_NODELAY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TCP_NODELAY@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #4
	bl	_setsockopt
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh21:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_pjdlog_errno
LBB0_8:
	mov	w22, #0
	ldr	w8, [x23]
	cmp	w8, w20
	cset	w8, ne
	stp	w8, w20, [x21, #4]
Lloh26:
	adrp	x8, _TCP_CTX_MAGIC@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TCP_CTX_MAGIC@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x21, #12]
	str	x21, [x19]
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
Lloh29:
	adrp	x8, _errno@GOTPAGE
Lloh30:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh31:
	ldr	w22, [x8]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_TCP_SIDE_CLIENT,4,2            ; @TCP_SIDE_CLIENT
	.comm	_TCP_SIDE_SERVER_LISTEN,4,2     ; @TCP_SIDE_SERVER_LISTEN
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp:port"

	.comm	_AF_UNSPEC,8,3                  ; @AF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.comm	_TCP_NODELAY,4,2                ; @TCP_NODELAY
	.comm	_LOG_WARNING,4,2                ; @LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"Unable to set TCP_NOELAY"

	.comm	_TCP_CTX_MAGIC,4,2              ; @TCP_CTX_MAGIC
	.no_dead_strip	_tcp_setup_new
.subsections_via_symbols
