	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_connect_tcp                 ## -- Begin function sm_connect_tcp
	.p2align	4, 0x90
_sm_connect_tcp:                        ## @sm_connect_tcp
	.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, %ebx
	movq	%rdi, %r14
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_PF_UNSPEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -100(%rbp)
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movq	$0, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdi
	movl	%ebx, %edx
	callq	_asprintf
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rsi
	leaq	-112(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	movq	%r14, %rdi
	callq	_getaddrinfo
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_free
	testl	%ebx, %ebx
	jne	LBB0_5
## %bb.3:
	movq	-64(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.6:
	movq	_F_GETFL@GOTPCREL(%rip), %r15
	movq	_F_SETFL@GOTPCREL(%rip), %r14
	xorl	%r13d, %r13d
	jmp	LBB0_7
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_F_GETFL@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_17
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r13d, %r13d
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%r13d, %edi
	callq	_close
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	16(%rbx), %edi
	movl	8(%rbx), %edx
	movl	12(%rbx), %esi
	callq	_socket
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r15), %esi
	movl	%r13d, %edi
	xorl	%eax, %eax
	callq	_fcntl
	movq	%rax, %r12
	testl	%r12d, %r12d
	js	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%r12d, %edx
	movl	%r13d, %edi
	xorl	%eax, %eax
	callq	_fcntl
	testq	%rax, %rax
	js	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movl	%r13d, %edi
	callq	_connect
	shrq	$63, %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	movq	_EINPROGRESS@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	setne	%dl
	cmpl	%edx, %eax
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	$0, -72(%rbp)
	movl	$500000, -80(%rbp)              ## imm = 0x7A120
	movq	%r14, %r15
	leaq	-52(%rbp), %r14
	movq	%r14, %rdi
	callq	_FD_ZERO
	movl	%r13d, %edi
	movq	%r14, %rsi
	callq	_FD_SET
	movq	%r15, %r14
	movl	(%r15), %esi
	movl	%r13d, %edi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_fcntl
	testq	%rax, %rax
	js	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	leal	1(%r13), %edi
	leaq	-52(%rbp), %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-80(%rbp), %r8
	callq	_select
	testl	%eax, %eax
	jne	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%r13d, %edi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_fcntl
	testq	%rax, %rax
	movq	_F_GETFL@GOTPCREL(%rip), %r15
	js	LBB0_16
## %bb.19:
	movl	%r13d, %r14d
	jmp	LBB0_20
LBB0_1:
	movl	$-1, %r14d
	jmp	LBB0_24
LBB0_17:
	movl	$-1, %r14d
LBB0_20:
	testl	%r13d, %r13d
	jle	LBB0_23
## %bb.21:
	testl	%r14d, %r14d
	jg	LBB0_23
## %bb.22:
	movl	%r13d, %edi
	callq	_close
	jmp	LBB0_23
LBB0_4:
	movl	$-1, %r14d
LBB0_23:
	movq	-64(%rbp), %rdi
	callq	_freeaddrinfo
LBB0_24:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	cmpl	$-1, %ebx
	movl	$-1, %r14d
	cmovll	%ebx, %r14d
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_UNSPEC,4,2                  ## @PF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d"

L_.str.1:                               ## @.str.1
	.asciz	"Unknown host"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_errno,8,3                      ## @errno
	.comm	_EINPROGRESS,8,3                ## @EINPROGRESS
	.comm	_FIONBIO,4,2                    ## @FIONBIO
	.comm	_INVALID_SOCKET,4,2             ## @INVALID_SOCKET
	.comm	_SOCKET_ERROR,8,3               ## @SOCKET_ERROR
	.comm	_WSAEINPROGRESS,8,3             ## @WSAEINPROGRESS
	.comm	_WSAEWOULDBLOCK,8,3             ## @WSAEWOULDBLOCK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_connect_tcp                 ; -- Begin function sm_connect_tcp
	.p2align	2
_sm_connect_tcp:                        ; @sm_connect_tcp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	add	x0, sp, #48
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh0:
	adrp	x8, _PF_UNSPEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_UNSPEC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #64]
Lloh3:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _IPPROTO_TCP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IPPROTO_TCP@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #56]
	str	xzr, [sp, #32]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #32
	mov	x2, x20
	bl	_asprintf
	tbnz	x0, #63, LBB0_15
; %bb.1:
	ldr	x1, [sp, #32]
	add	x2, sp, #48
	add	x3, sp, #40
	mov	x0, x19
	bl	_getaddrinfo
	mov	x19, x0
	ldr	x0, [sp, #32]
	bl	_free
	cbnz	w19, LBB0_22
; %bb.2:
	ldr	x21, [sp, #40]
	cbz	x21, LBB0_19
; %bb.3:
	mov	w19, #0
Lloh11:
	adrp	x22, _F_GETFL@GOTPAGE
Lloh12:
	ldr	x22, [x22, _F_GETFL@GOTPAGEOFF]
Lloh13:
	adrp	x23, _F_SETFL@GOTPAGE
Lloh14:
	ldr	x23, [x23, _F_SETFL@GOTPAGEOFF]
Lloh15:
	adrp	x24, _O_NONBLOCK@GOTPAGE
Lloh16:
	ldr	x24, [x24, _O_NONBLOCK@GOTPAGEOFF]
Lloh17:
	adrp	x25, _errno@GOTPAGE
Lloh18:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
	mov	w26, #41248
	movk	w26, #7, lsl #16
Lloh19:
	adrp	x27, _EINPROGRESS@GOTPAGE
Lloh20:
	ldr	x27, [x27, _EINPROGRESS@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x21, [x21, #24]
	cbz	x21, LBB0_16
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w19, #1
	b.lt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_close
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldp	w1, w0, [x21, #12]
	ldr	w2, [x21, #8]
	bl	_socket
	mov	x19, x0
	tbnz	w0, #31, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_fcntl
	mov	x20, x0
	tbnz	w20, #31, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x23]
	ldr	w8, [x24]
	orr	w8, w8, w20
	str	x8, [sp]
	mov	x0, x19
	bl	_fcntl
	tbnz	x0, #63, LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldp	w2, w1, [x21]
	mov	x0, x19
	bl	_connect
	lsr	x8, x0, #63
	ldr	x9, [x25]
	ldr	x10, [x27]
	cmp	x9, x10
	cset	w9, ne
	cmp	w8, w9
	b.eq	LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [sp, #24]
	str	w26, [sp, #16]
	add	x0, sp, #12
	bl	_FD_ZERO
	add	x1, sp, #12
	mov	x0, x19
	bl	_FD_SET
	ldr	w1, [x23]
	mov	x8, x20
	str	x8, [sp]
	mov	x0, x19
	bl	_fcntl
	tbnz	x0, #63, LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	add	w0, w19, #1
	add	x1, sp, #12
	add	x4, sp, #16
	mov	x2, #0
	mov	x3, #0
	bl	_select
	cbnz	w0, LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x23]
	ldr	w8, [x24]
	orr	w8, w8, w20
	str	x8, [sp]
	mov	x0, x19
	bl	_fcntl
	tbnz	x0, #63, LBB0_4
; %bb.14:
	mov	x20, x19
	b	LBB0_17
LBB0_15:
	mov	w20, #-1
	b	LBB0_21
LBB0_16:
	mov	w20, #-1
LBB0_17:
	cmp	w19, #1
	ccmp	w20, #0, #0, ge
	b.gt	LBB0_20
; %bb.18:
	mov	x0, x19
	bl	_close
	b	LBB0_20
LBB0_19:
	mov	w20, #-1
LBB0_20:
	ldr	x0, [sp, #40]
	bl	_freeaddrinfo
LBB0_21:
	mov	x0, x20
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_22:
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	cmn	w19, #1
	csinv	w20, w19, wzr, lt
	b	LBB0_21
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_UNSPEC,4,2                  ; @PF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d"

l_.str.1:                               ; @.str.1
	.asciz	"Unknown host"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_errno,8,3                      ; @errno
	.comm	_EINPROGRESS,8,3                ; @EINPROGRESS
	.comm	_FIONBIO,4,2                    ; @FIONBIO
	.comm	_INVALID_SOCKET,4,2             ; @INVALID_SOCKET
	.comm	_SOCKET_ERROR,8,3               ; @SOCKET_ERROR
	.comm	_WSAEINPROGRESS,8,3             ; @WSAEINPROGRESS
	.comm	_WSAEWOULDBLOCK,8,3             ; @WSAEWOULDBLOCK
.subsections_via_symbols
