	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fetch_connect                  ## -- Begin function fetch_connect
	.p2align	4, 0x90
_fetch_connect:                         ## @fetch_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_DEBUGF
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_fetch_info
LBB0_2:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_fetch_resolve
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %r15
	leaq	L_.str.2(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.4:
	cmpb	$0, (%rax)
	je	LBB0_10
## %bb.5:
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_fetch_info
	movq	%r14, %rax
LBB0_7:
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_fetch_resolve
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_11
	jmp	LBB0_32
LBB0_8:
	xorl	%r14d, %r14d
	jmp	LBB0_33
LBB0_10:
	xorl	%r12d, %r12d
LBB0_11:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	movq	_SOCK_STREAM@GOTPCREL(%rip), %r14
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movq	(%r15), %rdi
	movl	(%r14), %esi
	xorl	%edx, %edx
	callq	_socket
	testl	%eax, %eax
	js	LBB0_23
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%eax, %r13d
	testq	%r12, %r12
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	movq	%r12, %rbx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=2
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_18
LBB0_16:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rbx), %rcx
	cmpq	(%r15), %rcx
	jne	LBB0_15
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	movl	8(%rbx), %edx
	movl	12(%rbx), %esi
	movl	%r13d, %edi
	callq	_bind
	testl	%eax, %eax
	jne	LBB0_15
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	testl	%eax, %eax
	jne	LBB0_26
LBB0_19:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	8(%r15), %edx
	movl	12(%r15), %esi
	movl	%r13d, %edi
	callq	_connect
	testl	%eax, %eax
	je	LBB0_24
## %bb.20:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%r13d, %edi
	callq	_close
	movq	16(%r15), %r15
	testq	%r15, %r15
	jne	LBB0_12
## %bb.21:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_23
## %bb.22:
	leaq	L_.str.5(%rip), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_fetch_info
LBB0_23:
	xorl	%eax, %eax
	callq	_fetch_syserr
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_30:
	xorl	%r14d, %r14d
	testq	%r12, %r12
	je	LBB0_32
LBB0_31:
	movq	%r12, %rdi
	callq	_freeaddrinfo
LBB0_32:
	movq	%r15, %rdi
	callq	_freeaddrinfo
LBB0_33:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movl	%r13d, %edi
	callq	_fetch_reopen
	testq	%rax, %rax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_28
## %bb.25:
	movq	%rax, %r14
	testq	%r12, %r12
	jne	LBB0_31
	jmp	LBB0_32
LBB0_26:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_28
## %bb.27:
	leaq	L_.str.4(%rip), %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_fetch_info
LBB0_28:
	xorl	%eax, %eax
	callq	_fetch_syserr
	testl	%r13d, %r13d
	js	LBB0_30
## %bb.29:
	movl	%r13d, %edi
	callq	_close
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"---> %s:%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"resolving server address: %s:%d"

L_.str.2:                               ## @.str.2
	.asciz	"FETCH_BIND_ADDRESS"

L_.str.3:                               ## @.str.3
	.asciz	"resolving client address: %s"

	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.4:                               ## @.str.4
	.asciz	"failed to bind to %s"

L_.str.5:                               ## @.str.5
	.asciz	"failed to connect to %s:%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fetch_connect                  ; -- Begin function fetch_connect
	.p2align	2
_fetch_connect:                         ; @fetch_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x22
	bl	_DEBUGF
	cbz	w21, LBB0_2
; %bb.1:
	str	x22, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_fetch_info
LBB0_2:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_fetch_resolve
	cbz	x0, LBB0_26
; %bb.3:
	mov	x19, x0
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_getenv
	mov	x24, x0
	cbz	x0, LBB0_9
; %bb.4:
	ldrb	w8, [x24]
	cbz	w8, LBB0_9
; %bb.5:
	cbz	w21, LBB0_7
; %bb.6:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x24
	bl	_fetch_info
LBB0_7:
	mov	x0, x24
	mov	w1, #0
	mov	x2, x23
	bl	_fetch_resolve
	mov	x23, x0
	cbnz	x0, LBB0_10
; %bb.8:
	mov	x20, #0
	b	LBB0_25
LBB0_9:
	mov	x23, #0
LBB0_10:
Lloh8:
	adrp	x26, _SOCK_STREAM@GOTPAGE
Lloh9:
	ldr	x26, [x26, _SOCK_STREAM@GOTPAGEOFF]
	mov	x27, x19
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x0, [x27]
	ldr	w1, [x26]
	mov	w2, #0
	bl	_socket
	tbnz	w0, #31, LBB0_22
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x25, x0
	cbz	x23, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	w0, #0
	mov	x28, x23
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	ldr	x28, [x28, #16]
	cbz	x28, LBB0_17
LBB0_15:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x28]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	ldp	w2, w1, [x28, #8]
	mov	x0, x25
	bl	_bind
	cbnz	w0, LBB0_14
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=1
	cbnz	w0, LBB0_30
LBB0_18:                                ;   in Loop: Header=BB0_11 Depth=1
	ldp	w2, w1, [x27, #8]
	mov	x0, x25
	bl	_connect
	cbz	w0, LBB0_28
; %bb.19:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x25
	bl	_close
	ldr	x27, [x27, #16]
	cbnz	x27, LBB0_11
; %bb.20:
	cbz	w21, LBB0_22
; %bb.21:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	str	x22, [sp]
Lloh10:
	adrp	x0, l_.str.5@PAGE
Lloh11:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x20
	bl	_fetch_info
LBB0_22:
	bl	_fetch_syserr
LBB0_23:
	mov	x21, #0
	mov	x20, #0
	cbz	x23, LBB0_25
LBB0_24:
	mov	x0, x23
	bl	_freeaddrinfo
	mov	x20, x21
LBB0_25:
	mov	x0, x19
	bl	_freeaddrinfo
	b	LBB0_27
LBB0_26:
	mov	x20, #0
LBB0_27:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_28:
	mov	x0, x25
	bl	_fetch_reopen
	cbz	x0, LBB0_32
; %bb.29:
	mov	x21, x0
	mov	x20, x0
	cbnz	x23, LBB0_24
	b	LBB0_25
LBB0_30:
	cbz	w21, LBB0_32
; %bb.31:
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x24
	bl	_fetch_info
LBB0_32:
	bl	_fetch_syserr
	tbnz	w25, #31, LBB0_23
; %bb.33:
	mov	x0, x25
	bl	_close
	b	LBB0_23
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"---> %s:%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"resolving server address: %s:%d"

l_.str.2:                               ; @.str.2
	.asciz	"FETCH_BIND_ADDRESS"

l_.str.3:                               ; @.str.3
	.asciz	"resolving client address: %s"

	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.4:                               ; @.str.4
	.asciz	"failed to bind to %s"

l_.str.5:                               ; @.str.5
	.asciz	"failed to connect to %s:%d"

.subsections_via_symbols
