	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_connect
_tcp_connect:                           ## @tcp_connect
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%edi, %edi
	testq	%rbx, %rbx
	setne	%dil
	callq	_PJDLOG_ASSERT
	movq	(%rbx), %rax
	movq	_TCP_CTX_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	movq	8(%rbx), %rax
	movq	_TCP_SIDE_CLIENT@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	movq	16(%rbx), %rdi
	shrq	$63, %rdi
	xorl	$1, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_PJDLOG_ASSERT
	movq	24(%rbx), %rax
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_PJDLOG_ASSERT
	xorl	%edi, %edi
	cmpl	$-1, %r14d
	setge	%dil
	callq	_PJDLOG_ASSERT
	movq	16(%rbx), %rdi
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.3:
	movl	%eax, %r15d
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	16(%rbx), %rdi
	movq	_F_SETFL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	leaq	24(%rbx), %rsi
	movq	16(%rbx), %rdi
	movl	32(%rbx), %edx
	callq	_connect
	testq	%rax, %rax
	je	LBB0_6
## %bb.8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_9
## %bb.12:
	cmpl	$-1, %r14d
	je	LBB0_13
## %bb.14:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tcp_connect_wait               ## TAILCALL
LBB0_1:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_errno@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_errno@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rcx
LBB0_2:
	movl	$1, %esi
	callq	_pjdlog_common
	movl	(%rbx), %r12d
LBB0_7:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%r12d, %r12d
	cmpl	$-1, %r14d
	jne	LBB0_10
	jmp	LBB0_7
LBB0_9:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rcx
	movl	$1, %esi
	movl	%r12d, %edx
	callq	_pjdlog_common
LBB0_10:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %r15d
	movq	16(%rbx), %rdi
	movl	(%r13), %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.11:
	testl	%r12d, %r12d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmovel	%edx, %r12d
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rcx
	movl	$1, %esi
	callq	_pjdlog_common
	jmp	LBB0_7
LBB0_13:
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_TCP_CTX_MAGIC,8,3              ## @TCP_CTX_MAGIC
	.comm	_TCP_SIDE_CLIENT,8,3            ## @TCP_SIDE_CLIENT
	.comm	_AF_UNSPEC,8,3                  ## @AF_UNSPEC
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_LOG_DEBUG,4,2                  ## @LOG_DEBUG
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fcntl(F_GETFL) failed"

	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_F_SETFL,4,2                    ## @F_SETFL
L_.str.1:                               ## @.str.1
	.asciz	"fcntl(F_SETFL, O_NONBLOCK) failed"

	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
L_.str.2:                               ## @.str.2
	.asciz	"connect() failed"

L_.str.3:                               ## @.str.3
	.asciz	"fcntl(F_SETFL, ~O_NONBLOCK) failed"

	.no_dead_strip	_tcp_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_connect
_tcp_connect:                           ; @tcp_connect
	.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	x20, x1
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _TCP_CTX_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TCP_CTX_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _TCP_SIDE_CLIENT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TCP_SIDE_CLIENT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	ldr	x8, [x19, #16]
	lsr	x8, x8, #63
	eor	w0, w8, #0x1
	bl	_PJDLOG_ASSERT
	mov	x21, x19
	ldr	x8, [x21, #24]!
Lloh6:
	adrp	x9, _AF_UNSPEC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AF_UNSPEC@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	cmn	w20, #2
	cset	w0, gt
	bl	_PJDLOG_ASSERT
	ldr	x0, [x19, #16]
Lloh9:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.1:
Lloh12:
	adrp	x22, _O_NONBLOCK@GOTPAGE
Lloh13:
	ldr	x22, [x22, _O_NONBLOCK@GOTPAGEOFF]
	ldr	w8, [x22]
	orr	w24, w8, w0
	ldr	x0, [x19, #16]
Lloh14:
	adrp	x23, _F_SETFL@GOTPAGE
Lloh15:
	ldr	x23, [x23, _F_SETFL@GOTPAGEOFF]
	ldr	w1, [x23]
	str	x24, [sp]
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:
	ldr	x0, [x19, #16]
	ldr	w2, [x19, #32]
	mov	x1, x21
	bl	_connect
	cbz	x0, LBB0_10
; %bb.3:
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	w21, [x8]
Lloh19:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_11
; %bb.4:
	cmn	w20, #1
	b.eq	LBB0_14
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	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
	b	_tcp_connect_wait
LBB0_6:
Lloh22:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x19, _errno@GOTPAGE
Lloh26:
	ldr	x19, [x19, _errno@GOTPAGEOFF]
	ldr	w2, [x19]
Lloh27:
	adrp	x3, l_.str@PAGE
Lloh28:
	add	x3, x3, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh29:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
Lloh32:
	adrp	x19, _errno@GOTPAGE
Lloh33:
	ldr	x19, [x19, _errno@GOTPAGEOFF]
	ldr	w2, [x19]
Lloh34:
	adrp	x3, l_.str.1@PAGE
Lloh35:
	add	x3, x3, l_.str.1@PAGEOFF
LBB0_8:
	mov	w1, #1
	bl	_pjdlog_common
	ldr	w21, [x19]
LBB0_9:
	mov	x0, x21
	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:
	mov	w21, #0
	cmn	w20, #1
	b.ne	LBB0_12
	b	LBB0_9
LBB0_11:
Lloh36:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh37:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
Lloh39:
	adrp	x3, l_.str.2@PAGE
Lloh40:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	w1, #1
	mov	x2, x21
	bl	_pjdlog_common
LBB0_12:
	ldr	w8, [x22]
	bic	w8, w24, w8
	ldr	x0, [x19, #16]
	ldr	w1, [x23]
	str	x8, [sp]
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.13:
Lloh41:
	adrp	x8, _errno@GOTPAGE
Lloh42:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh43:
	ldr	w2, [x8]
	cmp	w21, #0
	csel	w21, w2, w21, eq
Lloh44:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh45:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
Lloh47:
	adrp	x3, l_.str.3@PAGE
Lloh48:
	add	x3, x3, l_.str.3@PAGEOFF
	mov	w1, #1
	bl	_pjdlog_common
	b	LBB0_9
LBB0_14:
	mov	w21, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_TCP_CTX_MAGIC,8,3              ; @TCP_CTX_MAGIC
	.comm	_TCP_SIDE_CLIENT,8,3            ; @TCP_SIDE_CLIENT
	.comm	_AF_UNSPEC,8,3                  ; @AF_UNSPEC
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_LOG_DEBUG,4,2                  ; @LOG_DEBUG
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fcntl(F_GETFL) failed"

	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_F_SETFL,4,2                    ; @F_SETFL
l_.str.1:                               ; @.str.1
	.asciz	"fcntl(F_SETFL, O_NONBLOCK) failed"

	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
l_.str.2:                               ; @.str.2
	.asciz	"connect() failed"

l_.str.3:                               ; @.str.3
	.asciz	"fcntl(F_SETFL, ~O_NONBLOCK) failed"

	.no_dead_strip	_tcp_connect
.subsections_via_symbols
