	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_socket
_open_socket:                           ## @open_socket
	.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	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	leaq	-72(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	leaq	-40(%rbp), %rcx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_getaddrinfo
	testl	%eax, %eax
	je	LBB0_1
## %bb.10:
	movl	%eax, %edi
	callq	_gai_strerror
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_warnx
	jmp	LBB0_8
LBB0_1:
	movq	-40(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.2:
	leaq	L_.str.1(%rip), %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
LBB0_3:                                 ## =>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_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r12d
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movl	%eax, %edi
	callq	_connect
	testq	%rax, %rax
	jns	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_warn
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_6
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_warnx
	movq	-40(%rbp), %rdi
	callq	_freeaddrinfo
LBB0_8:
	movl	$-1, %r12d
LBB0_9:
	movl	%r12d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	-40(%rbp), %rdi
	callq	_freeaddrinfo
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %s"

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

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

	.no_dead_strip	_open_socket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_socket
_open_socket:                           ; @open_socket
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh0:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _IPPROTO_TCP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IPPROTO_TCP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #16]
	add	x2, sp, #8
	add	x3, sp, #40
	mov	x0, x19
	mov	x1, x20
	bl	_getaddrinfo
	cbz	w0, LBB0_2
; %bb.1:
	bl	_gai_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_warnx
	b	LBB0_9
LBB0_2:
	ldr	x22, [sp, #40]
	cbz	x22, LBB0_8
; %bb.3:
Lloh8:
	adrp	x20, l_.str.1@PAGE
Lloh9:
	add	x20, x20, l_.str.1@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	x21, x0
	ldp	w2, w1, [x22]
	bl	_connect
	tbz	x0, #63, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_warn
	mov	x0, x21
	bl	_close
	b	LBB0_4
LBB0_8:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_warnx
	ldr	x0, [sp, #40]
	bl	_freeaddrinfo
LBB0_9:
	mov	w21, #-1
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_11:
	ldr	x0, [sp, #40]
	bl	_freeaddrinfo
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %s"

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

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

	.no_dead_strip	_open_socket
.subsections_via_symbols
