	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_establish_socks_proxy_passthru ## -- Begin function establish_socks_proxy_passthru
	.p2align	4, 0x90
_establish_socks_proxy_passthru:        ## @establish_socks_proxy_passthru
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	%rdx, %r13
	movl	%esi, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%r8, %rdx
	callq	_socks_handshake
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movl	$50331909, -176(%rbp)           ## imm = 0x3000105
	movq	%r13, %rdi
	callq	_strlen
	leaq	-122(%rax), %rcx
	cmpq	$-129, %rcx
	movl	$121, %ebx
	cmovaeq	%rax, %rbx
	movb	%bl, -172(%rbp)
	leaq	-171(%rbp), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	%r15, %rdi
	callq	_port_from_servname
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	rolw	$8, %ax
	leaq	-176(%rbp), %rsi
	movw	%ax, 5(%rbx,%rsi)
	addl	$7, %ebx
	movq	_MSG_NOSIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r12d, %edi
	movl	%ebx, %edx
	callq	_send
	cmpl	%eax, %ebx
	jne	LBB0_4
## %bb.5:
	movl	%r12d, %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_recv_socks_reply
	testl	%eax, %eax
	jne	LBB0_8
	jmp	LBB0_6
LBB0_2:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_msg
LBB0_6:
	cmpl	$0, (%r14)
	jne	LBB0_8
LBB0_7:
	movq	_SIGUSR1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_D_LINK_ERRORS@GOTPCREL(%rip), %rax
	movq	_M_ERRNO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_msg
	cmpl	$0, (%r14)
	jne	LBB0_8
	jmp	LBB0_7
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_D_LINK_ERRORS,4,2              ## @D_LINK_ERRORS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"establish_socks_proxy_passthrough: Cannot convert %s to port number"

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

	.comm	_SIGUSR1,4,2                    ## @SIGUSR1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_establish_socks_proxy_passthru ; -- Begin function establish_socks_proxy_passthru
	.p2align	2
_establish_socks_proxy_passthru:        ; @establish_socks_proxy_passthru
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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, x4
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	mov	x2, x4
	bl	_socks_handshake
	cbz	w0, LBB0_5
; %bb.1:
	mov	w8, #261
	movk	w8, #768, lsl #16
	str	w8, [sp, #8]
	mov	x0, x22
	bl	_strlen
	sub	x8, x0, #122
	cmn	x8, #129
	mov	w8, #121
	csel	x23, x8, x0, lo
	strb	w23, [sp, #12]
	add	x24, sp, #8
	add	x0, x24, #5
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
	mov	x0, x21
	bl	_port_from_servname
	cbz	w0, LBB0_4
; %bb.2:
	add	x8, x23, x24
	rev	w9, w0
	lsr	w9, w9, #16
	sturh	w9, [x8, #5]
	add	w21, w23, #7
Lloh3:
	adrp	x8, _MSG_NOSIGNAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSG_NOSIGNAL@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x21
	bl	_send
	cmp	w21, w0
	b.ne	LBB0_9
; %bb.3:
	mov	x0, x20
	mov	x1, #0
	mov	x2, x19
	bl	_recv_socks_reply
	cbnz	w0, LBB0_7
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_msg
LBB0_5:
	ldr	w8, [x19]
	cbnz	w8, LBB0_7
LBB0_6:
Lloh11:
	adrp	x8, _SIGUSR1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SIGUSR1@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.8:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_9:
Lloh17:
	adrp	x8, _D_LINK_ERRORS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _D_LINK_ERRORS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _M_ERRNO@GOTPAGE
Lloh21:
	ldr	x9, [x9, _M_ERRNO@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_msg
	ldr	w8, [x19]
	cbnz	w8, LBB0_7
	b	LBB0_6
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_D_LINK_ERRORS,4,2              ; @D_LINK_ERRORS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"establish_socks_proxy_passthrough: Cannot convert %s to port number"

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

	.comm	_SIGUSR1,4,2                    ; @SIGUSR1
.subsections_via_symbols
