	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evutil_socket_connect_         ## -- Begin function evutil_socket_connect_
	.p2align	4, 0x90
_evutil_socket_connect_:                ## @evutil_socket_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	%r12, %rdi
	testq	%r12, %r12
	js	LBB0_1
LBB0_4:
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_connect
	movq	%rax, %rcx
	movl	$1, %eax
	testq	%rcx, %rcx
	jns	LBB0_10
## %bb.5:
	movq	(%r14), %rdi
	callq	_evutil_socket_geterror
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_EVUTIL_ERR_CONNECT_RETRIABLE
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_10
## %bb.6:
	movl	%ebx, %edi
	callq	_EVUTIL_ERR_CONNECT_REFUSED
	movq	%rax, %rcx
	xorl	%eax, %eax
	cmpq	$1, %rcx
	sbbl	%eax, %eax
	orl	$2, %eax
	testq	%rcx, %rcx
	jne	LBB0_10
## %bb.7:
	testq	%r12, %r12
	js	LBB0_8
	jmp	LBB0_10
LBB0_1:
	movl	(%rbx), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movq	%rax, (%r14)
	testq	%rax, %rax
	js	LBB0_9
## %bb.2:
	movq	%rax, %rdi
	callq	_evutil_make_socket_nonblocking
	testq	%rax, %rax
	js	LBB0_8
## %bb.3:
	movq	(%r14), %rdi
	jmp	LBB0_4
LBB0_8:
	movq	(%r14), %rdi
	callq	_evutil_closesocket
	movq	$-1, (%r14)
LBB0_9:
	movl	$-1, %eax
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evutil_socket_connect_         ; -- Begin function evutil_socket_connect_
	.p2align	2
_evutil_socket_connect_:                ; @evutil_socket_connect_
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0]
	mov	x0, x22
	tbnz	x22, #63, LBB0_3
LBB0_1:
	mov	x1, x21
	mov	x2, x20
	bl	_connect
	tbnz	x0, #63, LBB0_6
; %bb.2:
	mov	w0, #1
	b	LBB0_12
LBB0_3:
	ldr	w0, [x21]
Lloh0:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	str	x0, [x19]
	tbnz	x0, #63, LBB0_11
; %bb.4:
	bl	_evutil_make_socket_nonblocking
	tbnz	x0, #63, LBB0_10
; %bb.5:
	ldr	x0, [x19]
	b	LBB0_1
LBB0_6:
	ldr	x0, [x19]
	bl	_evutil_socket_geterror
	mov	x20, x0
	bl	_EVUTIL_ERR_CONNECT_RETRIABLE
	cbz	x0, LBB0_8
; %bb.7:
	mov	w0, #0
	b	LBB0_12
LBB0_8:
	mov	x0, x20
	bl	_EVUTIL_ERR_CONNECT_REFUSED
	mov	x8, x0
	cmp	x0, #0
	mov	w9, #2
	csinv	w0, w9, wzr, ne
	cbnz	x8, LBB0_12
; %bb.9:
	tbz	x22, #63, LBB0_12
LBB0_10:
	ldr	x0, [x19]
	bl	_evutil_closesocket
	mov	x8, #-1
	str	x8, [x19]
LBB0_11:
	mov	w0, #-1
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
.subsections_via_symbols
