	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_connect
_do_connect:                            ## @do_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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	%rsp, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%edx, -68(%rbp)
	movq	_NI_MAXSERV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	leaq	-104(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movl	%r15d, %edi
	callq	_ntohs
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	callq	_snprintf
	leaq	-64(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_getaddrinfo
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %edi
	callq	_gai_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_errx
LBB0_2:
	movq	-64(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	leaq	L_.str.2(%rip), %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%rbx), %edi
	movl	8(%rbx), %edx
	movl	12(%rbx), %esi
	callq	_socket
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %r12d
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movl	%eax, %edi
	callq	_connect
	testq	%rax, %rax
	jns	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_warn
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_8
LBB0_9:
	movq	-64(%rbp), %rdi
	jmp	LBB0_10
LBB0_3:
	xorl	%edi, %edi
LBB0_10:
	callq	_freeaddrinfo
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	callq	_warnx
	movl	$-1, %r12d
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	-64(%rbp), %rdi
	callq	_freeaddrinfo
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TCP_NODELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-68(%rbp), %rcx
	movl	%r12d, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	jns	LBB0_13
## %bb.12:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_err
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NI_MAXSERV,4,2                 ## @NI_MAXSERV
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%u"

L_.str.1:                               ## @.str.1
	.asciz	"getaddrinfo(%s): %s"

L_.str.2:                               ## @.str.2
	.asciz	"connect(%s)"

L_.str.3:                               ## @.str.3
	.asciz	"failed to contact %s"

	.comm	_TCP_NODELAY,4,2                ## @TCP_NODELAY
L_.str.4:                               ## @.str.4
	.asciz	"setsockopt TCP_NODELAY"

	.no_dead_strip	_do_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_connect
_do_connect:                            ; @do_connect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #64
	mov	x20, x1
	mov	x19, x0
	mov	x23, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	stur	w2, [x29, #-60]
Lloh3:
	adrp	x8, _NI_MAXSERV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NI_MAXSERV@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x1fffffff0
	sub	x22, x8, x9
	mov	sp, x22
	sub	x0, x29, #104
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh8:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x24, _IPPROTO_TCP@GOTPAGE
Lloh12:
	ldr	x24, [x24, _IPPROTO_TCP@GOTPAGEOFF]
	ldr	w9, [x24]
	stp	w9, w8, [x29, #-96]
	mov	x0, x20
	bl	_ntohs
	mov	x3, x0
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	mov	x1, x21
	bl	_snprintf
	sub	x2, x29, #104
	sub	x3, x29, #72
	mov	x0, x19
	mov	x1, x22
	bl	_getaddrinfo
	cbz	w0, LBB0_2
; %bb.1:
	bl	_gai_strerror
	mov	x3, x0
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_errx
LBB0_2:
	ldur	x22, [x29, #-72]
	cbz	x22, LBB0_9
; %bb.3:
Lloh17:
	adrp	x21, l_.str.2@PAGE
Lloh18:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x22, [x22, #24]
	cbz	x22, LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w1, w0, [x22, #12]
	ldr	w2, [x22, #8]
	bl	_socket
	tbnz	w0, #31, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x20, x0
	ldp	w2, w1, [x22]
	bl	_connect
	tbz	x0, #63, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x19
	bl	_warn
	mov	x0, x20
	bl	_close
	b	LBB0_4
LBB0_8:
	ldur	x0, [x29, #-72]
	b	LBB0_10
LBB0_9:
	mov	x0, #0
LBB0_10:
	bl	_freeaddrinfo
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_warnx
	mov	w20, #-1
LBB0_11:
	mov	sp, x23
	ldur	x8, [x29, #-56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.12:
	mov	x0, x20
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldur	x0, [x29, #-72]
	bl	_freeaddrinfo
	ldr	w1, [x24]
Lloh24:
	adrp	x8, _TCP_NODELAY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TCP_NODELAY@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	sub	x3, x29, #60
	mov	x0, x20
	mov	w4, #4
	bl	_setsockopt
	tbz	x0, #63, LBB0_11
; %bb.14:
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_err
	b	LBB0_11
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_NI_MAXSERV,4,2                 ; @NI_MAXSERV
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%u"

l_.str.1:                               ; @.str.1
	.asciz	"getaddrinfo(%s): %s"

l_.str.2:                               ; @.str.2
	.asciz	"connect(%s)"

l_.str.3:                               ; @.str.3
	.asciz	"failed to contact %s"

	.comm	_TCP_NODELAY,4,2                ; @TCP_NODELAY
l_.str.4:                               ; @.str.4
	.asciz	"setsockopt TCP_NODELAY"

	.no_dead_strip	_do_connect
.subsections_via_symbols
