	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_connect_wait
_tcp_connect_wait:                      ## @tcp_connect_wait
	.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	$40, %rsp
	.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, %r15
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_PJDLOG_ASSERT
	movq	(%r15), %rax
	movq	_TCP_CTX_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	movq	8(%r15), %rax
	movq	_TCP_SIDE_CLIENT@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	xorl	%edi, %edi
	cmpl	$0, 16(%r15)
	sete	%dil
	callq	_PJDLOG_ASSERT
	movq	24(%r15), %rdi
	shrq	$63, %rdi
	xorl	$1, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_PJDLOG_ASSERT
	movl	%r14d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_PJDLOG_ASSERT
	movl	%r14d, -72(%rbp)
	movq	$0, -64(%rbp)
	leaq	-52(%rbp), %rbx
	leaq	-72(%rbp), %r14
	movq	_errno@GOTPCREL(%rip), %r12
	movq	_EINTR@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_FD_ZERO
	movq	24(%r15), %rdi
	movq	%rbx, %rsi
	callq	_FD_SET
	movq	24(%r15), %rdi
	incq	%rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_select
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %edx
	cmpl	(%r13), %edx
	je	LBB0_1
## %bb.5:
	movl	%edx, -44(%rbp)
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rcx
	jmp	LBB0_10
LBB0_2:
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	jmp	LBB0_12
LBB0_6:
	setg	%al
	movzbl	%al, %edi
	callq	_PJDLOG_ASSERT
	movq	24(%r15), %rdi
	leaq	-52(%rbp), %rsi
	callq	_FD_ISSET
	movl	%eax, %edi
	callq	_PJDLOG_ASSERT
	movl	$4, -48(%rbp)
	movq	24(%r15), %rdi
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	callq	_getsockopt
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	-44(%rbp), %edx
	testl	%edx, %edx
	je	LBB0_11
## %bb.9:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rcx
	jmp	LBB0_10
LBB0_7:
	movl	(%r12), %edx
	movl	%edx, -44(%rbp)
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rcx
LBB0_10:
	movl	$1, %esi
	callq	_pjdlog_common
LBB0_12:
	movq	24(%r15), %rdi
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.16:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	movq	24(%r15), %rdi
	movq	_F_SETFL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_21
## %bb.17:
	cmpl	$0, -44(%rbp)
	movl	(%r12), %edx
	jne	LBB0_19
## %bb.18:
	movl	%edx, -44(%rbp)
LBB0_19:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rcx
	jmp	LBB0_20
LBB0_13:
	cmpl	$0, -44(%rbp)
	movl	(%r12), %edx
	jne	LBB0_15
## %bb.14:
	movl	%edx, -44(%rbp)
LBB0_15:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rcx
LBB0_20:
	movl	$1, %esi
	callq	_pjdlog_common
LBB0_21:
	movl	-44(%rbp), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	$0, -44(%rbp)
	movl	$1, 16(%r15)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_TCP_CTX_MAGIC,8,3              ## @TCP_CTX_MAGIC
	.comm	_TCP_SIDE_CLIENT,8,3            ## @TCP_SIDE_CLIENT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_errno,4,2                      ## @errno
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_LOG_DEBUG,4,2                  ## @LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"select() failed"

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ## @SO_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"getsockopt(SO_ERROR) failed"

L_.str.2:                               ## @.str.2
	.asciz	"getsockopt(SO_ERROR) returned error"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
L_.str.3:                               ## @.str.3
	.asciz	"fcntl(F_GETFL) failed"

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

	.no_dead_strip	_tcp_connect_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_connect_wait
_tcp_connect_wait:                      ; @tcp_connect_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	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	w8, [x19, #16]
	cmp	w8, #0
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	ldr	x8, [x19, #24]
	lsr	x8, x8, #63
	eor	w0, w8, #0x1
	bl	_PJDLOG_ASSERT
	mvn	w8, w20
	lsr	w0, w8, #31
	bl	_PJDLOG_ASSERT
	str	w20, [sp, #32]
	str	xzr, [sp, #40]
Lloh6:
	adrp	x20, _errno@GOTPAGE
Lloh7:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
Lloh8:
	adrp	x21, _EINTR@GOTPAGE
Lloh9:
	ldr	x21, [x21, _EINTR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #28
	bl	_FD_ZERO
	ldr	x0, [x19, #24]
	add	x1, sp, #28
	bl	_FD_SET
	ldr	x8, [x19, #24]
	add	x0, x8, #1
	add	x2, sp, #28
	add	x4, sp, #32
	mov	x1, #0
	mov	x3, #0
	bl	_select
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x20]
	ldr	w8, [x21]
	cmp	w2, w8
	b.eq	LBB0_1
; %bb.3:
	str	w2, [sp, #20]
Lloh10:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x3, l_.str@PAGE
Lloh14:
	add	x3, x3, l_.str@PAGEOFF
	b	LBB0_10
LBB0_4:
	cbnz	w0, LBB0_6
; %bb.5:
Lloh15:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [sp, #20]
	b	LBB0_11
LBB0_6:
	cmp	w0, #0
	cset	w0, gt
	bl	_PJDLOG_ASSERT
	ldr	x0, [x19, #24]
	add	x1, sp, #28
	bl	_FD_ISSET
	bl	_PJDLOG_ASSERT
	mov	w8, #4
	str	w8, [sp, #24]
	ldr	x0, [x19, #24]
Lloh18:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _SO_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SO_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	add	x3, sp, #20
	add	x4, sp, #24
	bl	_getsockopt
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.7:
	ldr	w2, [sp, #20]
	cbz	w2, LBB0_21
; %bb.8:
Lloh24:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
Lloh27:
	adrp	x3, l_.str.2@PAGE
Lloh28:
	add	x3, x3, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_9:
	ldr	w2, [x20]
	str	w2, [sp, #20]
Lloh29:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
Lloh32:
	adrp	x3, l_.str.1@PAGE
Lloh33:
	add	x3, x3, l_.str.1@PAGEOFF
LBB0_10:
	mov	w1, #1
	bl	_pjdlog_common
LBB0_11:
	ldr	x0, [x19, #24]
Lloh34:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_16
; %bb.12:
Lloh37:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh38:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	bic	w8, w0, w8
	ldr	x0, [x19, #24]
Lloh40:
	adrp	x9, _F_SETFL@GOTPAGE
Lloh41:
	ldr	x9, [x9, _F_SETFL@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x9]
	str	x8, [sp]
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_20
; %bb.13:
	ldr	w8, [sp, #20]
	ldr	w2, [x20]
	cbnz	w8, LBB0_15
; %bb.14:
	str	w2, [sp, #20]
LBB0_15:
Lloh43:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh44:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
Lloh46:
	adrp	x3, l_.str.4@PAGE
Lloh47:
	add	x3, x3, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_16:
	ldr	w8, [sp, #20]
	ldr	w2, [x20]
	cbnz	w8, LBB0_18
; %bb.17:
	str	w2, [sp, #20]
LBB0_18:
Lloh48:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh49:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh50:
	ldr	w0, [x8]
Lloh51:
	adrp	x3, l_.str.3@PAGE
Lloh52:
	add	x3, x3, l_.str.3@PAGEOFF
LBB0_19:
	mov	w1, #1
	bl	_pjdlog_common
LBB0_20:
	ldr	w0, [sp, #20]
	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
	add	sp, sp, #96
	ret
LBB0_21:
	str	wzr, [sp, #20]
	mov	w8, #1
	str	w8, [x19, #16]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_TCP_CTX_MAGIC,8,3              ; @TCP_CTX_MAGIC
	.comm	_TCP_SIDE_CLIENT,8,3            ; @TCP_SIDE_CLIENT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_errno,4,2                      ; @errno
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_LOG_DEBUG,4,2                  ; @LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"select() failed"

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ; @SO_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"getsockopt(SO_ERROR) failed"

l_.str.2:                               ; @.str.2
	.asciz	"getsockopt(SO_ERROR) returned error"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
l_.str.3:                               ; @.str.3
	.asciz	"fcntl(F_GETFL) failed"

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

	.no_dead_strip	_tcp_connect_wait
.subsections_via_symbols
