	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_OpenConnection
_tcp_OpenConnection:                    ## @tcp_OpenConnection
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	%rsi, %rdi
	callq	_GetIpAddr
	movq	%rax, -48(%rbp)
	movq	_INADDR_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	_LogWARN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
LBB0_2:
	xorl	%eax, %eax
	callq	_log_Printf
	movl	$-2, %ebx
	jmp	LBB0_10
LBB0_3:
	movq	%r15, %rdi
	callq	_atoi
	movl	%eax, %edi
	callq	_htons
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_getservbyname
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
LBB0_6:
	movq	_LogPHASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	movq	%r15, %r8
	xorl	%eax, %eax
	callq	_log_Printf
	movq	_PF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	$-2, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:
	movl	%eax, %r15d
	leaq	-56(%rbp), %rsi
	movl	%eax, %edi
	movl	$24, %edx
	callq	_connect
	testq	%rax, %rax
	js	LBB0_9
## %bb.8:
	movl	%r15d, %ebx
	jmp	LBB0_10
LBB0_9:
	movq	_LogWARN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.4(%rip), %rsi
	movl	%r12d, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_log_Printf
	movl	%r15d, %edi
	callq	_close
LBB0_10:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_LogWARN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	movq	%r15, %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_INADDR_NONE,8,3                ## @INADDR_NONE
	.comm	_LogWARN,4,2                    ## @LogWARN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %s: unknown host\n"

L_.str.1:                               ## @.str.1
	.asciz	"tcp"

L_.str.2:                               ## @.str.2
	.asciz	"%s: %s: unknown service\n"

	.comm	_LogPHASE,4,2                   ## @LogPHASE
L_.str.3:                               ## @.str.3
	.asciz	"%s: Connecting to %s:%s/tcp\n"

	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.4:                               ## @.str.4
	.asciz	"%s: connect: %s\n"

	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_tcp_OpenConnection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_OpenConnection
_tcp_OpenConnection:                    ; @tcp_OpenConnection
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _AF_INET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	mov	x0, x1
	bl	_GetIpAddr
	str	x0, [sp, #16]
Lloh3:
	adrp	x8, _INADDR_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INADDR_NONE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _LogWARN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LogWARN@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x20
LBB0_2:
	bl	_log_Printf
	b	LBB0_9
LBB0_3:
	mov	x0, x21
	bl	_atoi
	bl	_htons
	str	x0, [sp, #8]
	cbnz	x0, LBB0_6
; %bb.4:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_getservbyname
	cbz	x0, LBB0_11
; %bb.5:
	ldr	x8, [x0]
	str	x8, [sp, #8]
LBB0_6:
Lloh13:
	adrp	x8, _LogPHASE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LogPHASE@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x19
	mov	x3, x20
	bl	_log_Printf
Lloh18:
	adrp	x8, _PF_INET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	tbnz	w0, #31, LBB0_9
; %bb.7:
	mov	x20, x0
	add	x1, sp, #8
	mov	w2, #24
	bl	_connect
	tbz	x0, #63, LBB0_10
; %bb.8:
Lloh24:
	adrp	x8, _LogWARN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LogWARN@GOTPAGEOFF]
Lloh26:
	ldr	w21, [x8]
Lloh27:
	adrp	x8, _errno@GOTPAGE
Lloh28:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	bl	_log_Printf
	mov	x0, x20
	bl	_close
LBB0_9:
	mov	w20, #-2
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
Lloh32:
	adrp	x8, _LogWARN@GOTPAGE
Lloh33:
	ldr	x8, [x8, _LogWARN@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_INADDR_NONE,8,3                ; @INADDR_NONE
	.comm	_LogWARN,4,2                    ; @LogWARN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %s: unknown host\n"

l_.str.1:                               ; @.str.1
	.asciz	"tcp"

l_.str.2:                               ; @.str.2
	.asciz	"%s: %s: unknown service\n"

	.comm	_LogPHASE,4,2                   ; @LogPHASE
l_.str.3:                               ; @.str.3
	.asciz	"%s: Connecting to %s:%s/tcp\n"

	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.4:                               ; @.str.4
	.asciz	"%s: connect: %s\n"

	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_tcp_OpenConnection
.subsections_via_symbols
