	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_link_socket_init_phase2        ## -- Begin function link_socket_init_phase2
	.p2align	4, 0x90
_link_socket_init_phase2:               ## @link_socket_init_phase2
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, -48(%rbp)
	callq	_ASSERT
	movq	%r14, %rdi
	callq	_ASSERT
	movl	(%r14), %r12d
	testl	%r12d, %r12d
	je	LBB0_2
## %bb.1:
	movl	$0, (%r14)
LBB0_2:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_socket_frame_init
	cmpq	$0, 72(%r15)
	je	LBB0_3
## %bb.4:
	movq	8(%r15), %rdx
	movq	%rdx, -48(%rbp)
	cmpq	$0, 64(%r15)
	je	LBB0_7
LBB0_6:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rcx
	callq	_phase2_inetd
LBB0_26:
	cmpl	$0, (%r14)
	jne	LBB0_28
## %bb.27:
	movq	%r15, %rdi
	callq	_phase2_set_socket_flags
	movq	%r15, %rdi
	callq	_linksock_print_addr
	jmp	LBB0_28
LBB0_3:
	xorl	%edx, %edx
	cmpq	$0, 64(%r15)
	jne	LBB0_6
LBB0_7:
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	$2, %esi
	movq	%r14, %rcx
	callq	_resolve_remote
	movq	40(%r15), %rax
	movq	16(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	_create_socket
LBB0_9:
	movl	16(%r15), %eax
	movq	_SOCKET_UNDEFINED@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_16
## %bb.10:
	cmpq	$0, 56(%r15)
	je	LBB0_17
## %bb.11:
	cmpq	$0, 8(%r15)
	jne	LBB0_17
## %bb.12:
	movq	40(%r15), %rax
	movq	8(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.13:
	movq	24(%r15), %rax
	movq	_AF_UNSPEC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.14:
	movq	_M_WARN@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	(%rsi), %rdi
	callq	_addr_family_name
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_msg
	movq	40(%r15), %rax
	movq	8(%rax), %rsi
	movq	(%rsi), %rax
	movq	%rax, 24(%r15)
LBB0_15:
	movq	%r15, %rdi
	callq	_create_socket
	movl	16(%r15), %eax
	movl	(%rbx), %ecx
LBB0_16:
	cmpl	%ecx, %eax
	jne	LBB0_18
LBB0_17:
	movq	_M_WARN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_msg
	movq	_SIGUSR1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_28
LBB0_18:
	cmpl	$0, (%r14)
	je	LBB0_19
LBB0_28:
	testl	%r12d, %r12d
	je	LBB0_31
## %bb.29:
	cmpl	$0, (%r14)
	jne	LBB0_31
## %bb.30:
	movl	%r12d, (%r14)
LBB0_31:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	32(%r15), %rax
	movq	_PROTO_TCP_SERVER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.20:
	movq	-48(%rbp), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_phase2_tcp_server
	jmp	LBB0_26
LBB0_21:
	movq	_PROTO_TCP_CLIENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.22:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_phase2_tcp_client
	jmp	LBB0_26
LBB0_23:
	movq	_PROTO_UDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_26
## %bb.24:
	cmpq	$0, 48(%r15)
	je	LBB0_26
## %bb.25:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_phase2_socks_client
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCKET_UNDEFINED,4,2           ## @SOCKET_UNDEFINED
	.comm	_AF_UNSPEC,8,3                  ## @AF_UNSPEC
	.comm	_M_WARN,4,2                     ## @M_WARN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not determine IPv4/IPv6 protocol. Using %s"

L_.str.1:                               ## @.str.1
	.asciz	"Could not determine IPv4/IPv6 protocol"

	.comm	_SIGUSR1,4,2                    ## @SIGUSR1
	.comm	_PROTO_TCP_SERVER,8,3           ## @PROTO_TCP_SERVER
	.comm	_PROTO_TCP_CLIENT,8,3           ## @PROTO_TCP_CLIENT
	.comm	_PROTO_UDP,8,3                  ## @PROTO_UDP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_link_socket_init_phase2        ; -- Begin function link_socket_init_phase2
	.p2align	2
_link_socket_init_phase2:               ; @link_socket_init_phase2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	bl	_ASSERT
	mov	x0, x19
	bl	_ASSERT
	ldr	w22, [x19]
	cbz	w22, LBB0_2
; %bb.1:
	str	wzr, [x19]
LBB0_2:
	mov	x0, x21
	mov	x1, x20
	bl	_socket_frame_init
	ldr	x8, [x20, #72]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x2, [x20, #8]
	str	x2, [sp, #8]
	ldr	x8, [x20, #64]
	cbz	x8, LBB0_8
LBB0_4:
	mov	x0, x20
	mov	x1, x21
	mov	x3, x19
	bl	_phase2_inetd
LBB0_5:
	ldr	w8, [x19]
	cbnz	w8, LBB0_20
; %bb.6:
	mov	x0, x20
	bl	_phase2_set_socket_flags
	mov	x0, x20
	bl	_linksock_print_addr
	b	LBB0_20
LBB0_7:
	mov	x2, #0
	ldr	x8, [x20, #64]
	cbnz	x8, LBB0_4
LBB0_8:
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #2
	mov	x3, x19
	bl	_resolve_remote
	ldr	x8, [x20, #40]
	ldr	x1, [x8, #16]
	cbz	x1, LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_create_socket
LBB0_10:
	ldr	w8, [x20, #16]
Lloh0:
	adrp	x23, _SOCKET_UNDEFINED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SOCKET_UNDEFINED@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.11:
	ldr	x8, [x20, #56]
	cbz	x8, LBB0_18
; %bb.12:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_18
; %bb.13:
	ldr	x8, [x20, #40]
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_18
; %bb.14:
	ldr	x8, [x20, #24]
Lloh2:
	adrp	x9, _AF_UNSPEC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_UNSPEC@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
Lloh5:
	adrp	x8, _M_WARN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_WARN@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
	ldr	x0, [x1]
	bl	_addr_family_name
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_msg
	ldr	x8, [x20, #40]
	ldr	x1, [x8, #8]
	ldr	x8, [x1]
	str	x8, [x20, #24]
LBB0_16:
	mov	x0, x20
	bl	_create_socket
	ldr	w8, [x20, #16]
	ldr	w9, [x23]
LBB0_17:
	cmp	w8, w9
	b.ne	LBB0_19
LBB0_18:
Lloh10:
	adrp	x8, _M_WARN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _M_WARN@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_msg
Lloh15:
	adrp	x8, _SIGUSR1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SIGUSR1@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_20
LBB0_19:
	ldr	w8, [x19]
	cbz	w8, LBB0_24
LBB0_20:
	cbz	w22, LBB0_23
; %bb.21:
	ldr	w8, [x19]
	cbnz	w8, LBB0_23
; %bb.22:
	str	w22, [x19]
LBB0_23:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_24:
	ldr	x8, [x20, #32]
Lloh18:
	adrp	x9, _PROTO_TCP_SERVER@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PROTO_TCP_SERVER@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.25:
	ldr	x1, [sp, #8]
	mov	x0, x20
	mov	x2, x19
	bl	_phase2_tcp_server
	b	LBB0_5
LBB0_26:
Lloh21:
	adrp	x9, _PROTO_TCP_CLIENT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PROTO_TCP_CLIENT@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.27:
	mov	x0, x20
	mov	x1, x19
	bl	_phase2_tcp_client
	b	LBB0_5
LBB0_28:
Lloh24:
	adrp	x9, _PROTO_UDP@GOTPAGE
Lloh25:
	ldr	x9, [x9, _PROTO_UDP@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.29:
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_5
; %bb.30:
	mov	x0, x20
	mov	x1, x19
	bl	_phase2_socks_client
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCKET_UNDEFINED,4,2           ; @SOCKET_UNDEFINED
	.comm	_AF_UNSPEC,8,3                  ; @AF_UNSPEC
	.comm	_M_WARN,4,2                     ; @M_WARN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not determine IPv4/IPv6 protocol. Using %s"

l_.str.1:                               ; @.str.1
	.asciz	"Could not determine IPv4/IPv6 protocol"

	.comm	_SIGUSR1,4,2                    ; @SIGUSR1
	.comm	_PROTO_TCP_SERVER,8,3           ; @PROTO_TCP_SERVER
	.comm	_PROTO_TCP_CLIENT,8,3           ; @PROTO_TCP_CLIENT
	.comm	_PROTO_UDP,8,3                  ; @PROTO_UDP
.subsections_via_symbols
