	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_connecttcp                     ## -- Begin function connecttcp
	.p2align	4, 0x90
_connecttcp:                            ## @connecttcp
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movq	_AF_INET@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	%eax, -32(%rbp)
	movzwl	%bx, %edi
	callq	_htons
	movl	%eax, -36(%rbp)
	movsbl	(%r14), %edi
	callq	_ISDIGIT
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_inet_aton
	cmpl	$-1, %eax
	jne	LBB0_5
	jmp	LBB0_2
LBB0_3:
	movq	%r14, %rdi
	callq	_gethostbyname
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	(%rax), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdi
	movl	$4, %edx
	callq	_memcpy
LBB0_5:
	movl	(%r15), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	$-1, %r14d
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.6:
	movl	%eax, %ebx
	leaq	-40(%rbp), %rsi
	movl	%eax, %edi
	movl	$12, %edx
	callq	_connect
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.7:
	movl	%ebx, %r14d
	jmp	LBB0_10
LBB0_2:
	movl	$-1, %r14d
	jmp	LBB0_10
LBB0_9:
	movl	%ebx, %edi
	callq	_close
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,4,2                    ## @AF_INET
	.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	_connecttcp                     ; -- Begin function connecttcp
	.p2align	2
_connecttcp:                            ; @connecttcp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	mov	x0, sp
	mov	w1, #0
	mov	w2, #12
	bl	_memset
Lloh0:
	adrp	x21, _AF_INET@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AF_INET@GOTPAGEOFF]
	ldr	w8, [x21]
	str	w8, [sp, #8]
	and	w0, w20, #0xffff
	bl	_htons
	str	w0, [sp, #4]
	ldrsb	w0, [x19]
	bl	_ISDIGIT
	cbz	x0, LBB0_2
; %bb.1:
	mov	x1, sp
	mov	x0, x19
	bl	_inet_aton
	cmn	w0, #1
	b.ne	LBB0_4
	b	LBB0_7
LBB0_2:
	mov	x0, x19
	bl	_gethostbyname
	cbz	x0, LBB0_7
; %bb.3:
	ldr	x8, [x0]
	ldr	w1, [x8]
	mov	x0, sp
	mov	w2, #4
	bl	_memcpy
LBB0_4:
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.5:
	mov	x1, sp
	mov	x0, x19
	mov	w2, #12
	bl	_connect
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x19
	bl	_close
LBB0_7:
	mov	w19, #-1
LBB0_8:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
.subsections_via_symbols
