	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function socks_handshake
_socks_handshake:                       ## @socks_handshake
	.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
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movb	$0, -42(%rbp)
	movw	$261, -44(%rbp)                 ## imm = 0x105
	movq	(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movb	$2, -42(%rbp)
LBB0_2:
	movq	_MSG_NOSIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	movl	$3, %edx
	callq	_send
	cmpl	$3, %eax
	jne	LBB0_18
## %bb.3:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leaq	1(%r13), %r14
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_FD_ZERO
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_openvpn_fd_set
	movl	$5, -72(%rbp)
	movq	$0, -64(%rbp)
	leaq	-72(%rbp), %r8
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_select
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_get_signal
	cmpl	$0, (%r12)
	jne	LBB0_22
## %bb.4:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str.1(%rip), %rsi
	testl	%r15d, %r15d
	je	LBB0_20
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	js	LBB0_20
## %bb.6:
	movq	%r14, %rbx
	movq	_MSG_NOSIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-41(%rbp), %rsi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_recv
	leaq	L_.str.3(%rip), %rsi
	cmpl	$1, %eax
	jne	LBB0_20
## %bb.7:
	movb	-41(%rbp), %r12b
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_FD_ZERO
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_openvpn_fd_set
	movl	$5, -72(%rbp)
	movq	$0, -64(%rbp)
	leaq	-72(%rbp), %r8
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_select
	movl	%eax, %r15d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_get_signal
	cmpl	$0, (%rbx)
	jne	LBB0_22
## %bb.8:
	testl	%r15d, %r15d
	leaq	L_.str.1(%rip), %rsi
	je	LBB0_20
## %bb.9:
	leaq	L_.str.2(%rip), %rsi
	js	LBB0_20
## %bb.10:
	movq	_MSG_NOSIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-41(%rbp), %rsi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_recv
	leaq	L_.str.3(%rip), %rsi
	cmpl	$1, %eax
	jne	LBB0_20
## %bb.11:
	cmpb	$5, %r12b
	jne	LBB0_24
## %bb.12:
	movsbl	-41(%rbp), %eax
	cmpb	-42(%rbp), %al
	jne	LBB0_25
## %bb.13:
	testl	%eax, %eax
	je	LBB0_17
## %bb.14:
	cmpl	$2, %eax
	jne	LBB0_26
## %bb.15:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_27
## %bb.16:
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_socks_username_password_auth
	testl	%eax, %eax
	je	LBB0_22
LBB0_17:
	movl	$1, %eax
	jmp	LBB0_23
LBB0_18:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movq	_M_ERRNO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_21
LBB0_20:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movq	_M_ERRNO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
LBB0_21:
	callq	_msg
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_21
LBB0_25:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_21
LBB0_26:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_21
LBB0_27:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L___const.socks_handshake.method_sel:   ## @__const.socks_handshake.method_sel
	.asciz	"\005\001"

	.comm	_MSG_NOSIGNAL,4,2               ## @MSG_NOSIGNAL
	.comm	_D_LINK_ERRORS,4,2              ## @D_LINK_ERRORS
	.comm	_M_ERRNO,4,2                    ## @M_ERRNO
L_.str:                                 ## @.str
	.asciz	"socks_handshake: TCP port write failed on send()"

L_.str.1:                               ## @.str.1
	.asciz	"socks_handshake: TCP port read timeout expired"

L_.str.2:                               ## @.str.2
	.asciz	"socks_handshake: TCP port read failed on select()"

L_.str.3:                               ## @.str.3
	.asciz	"socks_handshake: TCP port read failed on recv()"

L_.str.4:                               ## @.str.4
	.asciz	"socks_handshake: Socks proxy returned bad status"

L_.str.5:                               ## @.str.5
	.asciz	"socks_handshake: Socks proxy returned unexpected auth"

L_.str.6:                               ## @.str.6
	.asciz	"socks_handshake: server asked for username/login auth but we were not provided any credentials"

L_.str.7:                               ## @.str.7
	.asciz	"socks_handshake: unknown SOCKS auth method"

	.no_dead_strip	_socks_handshake
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function socks_handshake
_socks_handshake:                       ; @socks_handshake
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	strb	wzr, [sp, #30]
	mov	w8, #261
	strh	w8, [sp, #28]
	ldr	x8, [x0]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w8, #2
	strb	w8, [sp, #30]
LBB0_2:
Lloh0:
	adrp	x24, _MSG_NOSIGNAL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MSG_NOSIGNAL@GOTPAGEOFF]
	ldr	w3, [x24]
	add	x1, sp, #28
	mov	x0, x20
	mov	w2, #3
	bl	_send
	cmp	w0, #3
	b.ne	LBB0_18
; %bb.3:
	add	x22, x20, #1
	add	x0, sp, #24
	bl	_FD_ZERO
	add	x1, sp, #24
	mov	x0, x20
	bl	_openvpn_fd_set
	mov	w8, #5
	str	w8, [sp, #8]
	str	xzr, [sp, #16]
	add	x1, sp, #24
	add	x4, sp, #8
	mov	x0, x22
	mov	x2, #0
	mov	x3, #0
	bl	_select
	mov	x23, x0
	mov	x0, x19
	bl	_get_signal
	ldr	w8, [x19]
	cbnz	w8, LBB0_24
; %bb.4:
	cbz	w23, LBB0_19
; %bb.5:
	tbnz	w23, #31, LBB0_20
; %bb.6:
	ldr	w3, [x24]
	add	x1, sp, #7
	mov	x0, x20
	mov	w2, #1
	bl	_recv
	cmp	w0, #1
	b.ne	LBB0_21
; %bb.7:
	ldrb	w23, [sp, #7]
	add	x0, sp, #24
	bl	_FD_ZERO
	add	x1, sp, #24
	mov	x0, x20
	bl	_openvpn_fd_set
	mov	w8, #5
	str	w8, [sp, #8]
	str	xzr, [sp, #16]
	add	x1, sp, #24
	add	x4, sp, #8
	mov	x0, x22
	mov	x2, #0
	mov	x3, #0
	bl	_select
	mov	x22, x0
	mov	x0, x19
	bl	_get_signal
	ldr	w8, [x19]
	cbnz	w8, LBB0_24
; %bb.8:
	cbz	w22, LBB0_19
; %bb.9:
	tbnz	w22, #31, LBB0_20
; %bb.10:
	ldr	w3, [x24]
	add	x1, sp, #7
	mov	x0, x20
	mov	w2, #1
	bl	_recv
	cmp	w0, #1
	b.ne	LBB0_21
; %bb.11:
	cmp	w23, #5
	b.ne	LBB0_26
; %bb.12:
	ldrsb	w8, [sp, #7]
	ldrb	w9, [sp, #30]
	cmp	w9, w8, uxtb
	b.ne	LBB0_27
; %bb.13:
	cbz	w8, LBB0_17
; %bb.14:
	cmp	w8, #2
	b.ne	LBB0_28
; %bb.15:
	ldr	x8, [x21]
	ldr	x8, [x8]
	cbz	x8, LBB0_29
; %bb.16:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_socks_username_password_auth
	cbz	w0, LBB0_25
LBB0_17:
	mov	w0, #1
	b	LBB0_25
LBB0_18:
Lloh2:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _M_ERRNO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _M_ERRNO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_23
LBB0_19:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_22
LBB0_20:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_22
LBB0_21:
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_22:
Lloh16:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _M_ERRNO@GOTPAGE
Lloh20:
	ldr	x9, [x9, _M_ERRNO@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w0, w9, w8
LBB0_23:
	bl	_msg
LBB0_24:
	mov	w0, #0
LBB0_25:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_26:
Lloh22:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_23
LBB0_27:
Lloh27:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
Lloh30:
	adrp	x1, l_.str.5@PAGE
Lloh31:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_23
LBB0_28:
Lloh32:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh33:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
Lloh35:
	adrp	x1, l_.str.7@PAGE
Lloh36:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_23
LBB0_29:
Lloh37:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh38:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
Lloh40:
	adrp	x1, l_.str.6@PAGE
Lloh41:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_23
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l___const.socks_handshake.method_sel:   ; @__const.socks_handshake.method_sel
	.asciz	"\005\001"

	.comm	_MSG_NOSIGNAL,4,2               ; @MSG_NOSIGNAL
	.comm	_D_LINK_ERRORS,4,2              ; @D_LINK_ERRORS
	.comm	_M_ERRNO,4,2                    ; @M_ERRNO
l_.str:                                 ; @.str
	.asciz	"socks_handshake: TCP port write failed on send()"

l_.str.1:                               ; @.str.1
	.asciz	"socks_handshake: TCP port read timeout expired"

l_.str.2:                               ; @.str.2
	.asciz	"socks_handshake: TCP port read failed on select()"

l_.str.3:                               ; @.str.3
	.asciz	"socks_handshake: TCP port read failed on recv()"

l_.str.4:                               ; @.str.4
	.asciz	"socks_handshake: Socks proxy returned bad status"

l_.str.5:                               ; @.str.5
	.asciz	"socks_handshake: Socks proxy returned unexpected auth"

l_.str.6:                               ; @.str.6
	.asciz	"socks_handshake: server asked for username/login auth but we were not provided any credentials"

l_.str.7:                               ; @.str.7
	.asciz	"socks_handshake: unknown SOCKS auth method"

	.no_dead_strip	_socks_handshake
.subsections_via_symbols
