	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rmtgetconn                     ## -- Begin function rmtgetconn
	.p2align	4, 0x90
_rmtgetconn:                            ## @rmtgetconn
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, _rmtgetconn.sp(%rip)
	jne	LBB0_7
## %bb.1:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_getservbyname
	movq	%rax, _rmtgetconn.sp(%rip)
	testq	%rax, %rax
	je	LBB0_2
## %bb.5:
	xorl	%eax, %eax
	callq	_getuid
	movl	%eax, %edi
	callq	_getpwuid
	movq	%rax, _rmtgetconn.pwd(%rip)
	testq	%rax, %rax
	je	LBB0_6
LBB0_7:
	movq	_rmtpeer@GOTPCREL(%rip), %r15
	movq	(%r15), %r14
	movq	%r14, %rdi
	movl	$64, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %rbx
	movb	$0, (%rax)
	movq	%r14, %rdi
	callq	_okname
	testl	%eax, %eax
	je	LBB0_4
## %bb.9:
	incq	%rbx
	movq	%rbx, (%r15)
	jmp	LBB0_11
LBB0_10:
	movq	_rmtgetconn.pwd(%rip), %rax
	movq	(%rax), %r14
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
	callq	_getenv
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	__PATH_RMT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_13:
	leaq	L_.str.5(%rip), %rdi
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_msg
	movq	_rmtgetconn.sp(%rip), %rax
	movl	(%rax), %esi
	movq	_rmtgetconn.pwd(%rip), %rax
	movq	(%rax), %rdx
	movq	_rmtpeer@GOTPCREL(%rip), %r15
	movq	_errfd@GOTPCREL(%rip), %r9
	movq	%r15, %rdi
	movq	%r14, %rcx
	movq	%rbx, %r8
	callq	_rcmd
	movq	_rmtape@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	testq	%rax, %rax
	js	LBB0_23
## %bb.14:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rdx
	leaq	L_.str.8(%rip), %rsi
	callq	_fprintf
	movq	_ntrec@GOTPCREL(%rip), %rax
	movq	_TP_BSIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movl	(%rax), %eax
	imull	%ecx, %eax
	cmpl	$61440, %eax                    ## imm = 0xF000
	movl	$61440, %edx                    ## imm = 0xF000
	cmovll	%eax, %edx
	addl	$2048, %edx                     ## imm = 0x800
	movl	%edx, -44(%rbp)
	cmpl	%ecx, %edx
	jle	LBB0_18
## %bb.15:
	movq	_SOL_SOCKET@GOTPCREL(%rip), %r15
	movq	_SO_SNDBUF@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %rbx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	movl	(%r15), %esi
	movl	(%r13), %edx
	movq	%rbx, %rcx
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	jns	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	(%r14), %eax
	movl	-44(%rbp), %ecx
	subl	%eax, %ecx
	movl	%ecx, -44(%rbp)
	cmpl	%eax, %ecx
	jg	LBB0_16
LBB0_18:
	movq	(%r12), %rdi
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_RCVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	movq	_IPTOS_THROUGHPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	(%r12), %rdi
	movq	_IPPROTO_IP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IP_TOS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-52(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	js	LBB0_19
LBB0_20:
	movl	$1, -48(%rbp)
	movq	(%r12), %rdi
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TCP_NODELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	js	LBB0_21
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	(%r15), %rsi
	leaq	L_.str.7(%rip), %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_msg                            ## TAILCALL
LBB0_19:
	leaq	L_.str.9(%rip), %rdi
	callq	_perror
	jmp	LBB0_20
LBB0_21:
	leaq	L_.str.10(%rip), %rdi
	callq	_perror
	jmp	LBB0_22
LBB0_2:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
LBB0_3:
	xorl	%eax, %eax
	callq	_msg
LBB0_4:
	movq	_X_STARTUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_rmtgetconn.sp,8,3 ## @rmtgetconn.sp
.zerofill __DATA,__bss,_rmtgetconn.pwd,8,3 ## @rmtgetconn.pwd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"shell"

L_.str.1:                               ## @.str.1
	.asciz	"tcp"

L_.str.2:                               ## @.str.2
	.asciz	"shell/tcp: unknown service\n"

	.comm	_X_STARTUP,4,2                  ## @X_STARTUP
L_.str.3:                               ## @.str.3
	.asciz	"who are you?\n"

	.comm	_rmtpeer,8,3                    ## @rmtpeer
L_.str.4:                               ## @.str.4
	.asciz	"RMT"

	.comm	__PATH_RMT,8,3                  ## @_PATH_RMT
L_.str.5:                               ## @.str.5
	.asciz	"%s"

L_.str.6:                               ## @.str.6
	.space	1

	.comm	_errfd,4,2                      ## @errfd
	.comm	_rmtape,8,3                     ## @rmtape
L_.str.7:                               ## @.str.7
	.asciz	"login to %s as %s failed.\n"

	.comm	_stderr,4,2                     ## @stderr
L_.str.8:                               ## @.str.8
	.asciz	"Connection to %s established.\n"

	.comm	_ntrec,4,2                      ## @ntrec
	.comm	_TP_BSIZE,4,2                   ## @TP_BSIZE
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_SNDBUF,4,2                  ## @SO_SNDBUF
	.comm	_SO_RCVBUF,4,2                  ## @SO_RCVBUF
	.comm	_IPTOS_THROUGHPUT,4,2           ## @IPTOS_THROUGHPUT
	.comm	_IPPROTO_IP,4,2                 ## @IPPROTO_IP
	.comm	_IP_TOS,4,2                     ## @IP_TOS
L_.str.9:                               ## @.str.9
	.asciz	"IP_TOS:IPTOS_THROUGHPUT setsockopt"

	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.comm	_TCP_NODELAY,4,2                ## @TCP_NODELAY
L_.str.10:                              ## @.str.10
	.asciz	"TCP_NODELAY setsockopt"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rmtgetconn                     ; -- Begin function rmtgetconn
	.p2align	2
_rmtgetconn:                            ; @rmtgetconn
	.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
	adrp	x22, _rmtgetconn.sp@PAGE
	ldr	x8, [x22, _rmtgetconn.sp@PAGEOFF]
	adrp	x23, _rmtgetconn.pwd@PAGE
	cbnz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_getservbyname
	str	x0, [x22, _rmtgetconn.sp@PAGEOFF]
	cbz	x0, LBB0_18
; %bb.2:
	bl	_getuid
	bl	_getpwuid
	str	x0, [x23, _rmtgetconn.pwd@PAGEOFF]
	cbz	x0, LBB0_19
LBB0_3:
Lloh4:
	adrp	x21, _rmtpeer@GOTPAGE
Lloh5:
	ldr	x21, [x21, _rmtpeer@GOTPAGEOFF]
	ldr	x19, [x21]
	mov	x0, x19
	mov	w1, #64
	bl	_strchr
	cbz	x0, LBB0_6
; %bb.4:
	mov	x20, x0
	strb	wzr, [x0]
	mov	x0, x19
	bl	_okname
	cbz	w0, LBB0_21
; %bb.5:
	add	x8, x20, #1
	str	x8, [x21]
	b	LBB0_7
LBB0_6:
	ldr	x8, [x23, _rmtgetconn.pwd@PAGEOFF]
	ldr	x19, [x8]
LBB0_7:
Lloh6:
	adrp	x0, l_.str.4@PAGE
Lloh7:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_getenv
Lloh8:
	adrp	x8, __PATH_RMT@GOTPAGE
Lloh9:
	ldr	x8, [x8, __PATH_RMT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x21, x8, x0, eq
Lloh11:
	adrp	x8, l_.str.6@PAGE
Lloh12:
	add	x8, x8, l_.str.6@PAGEOFF
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.5@PAGE
Lloh14:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_msg
	ldr	x8, [x22, _rmtgetconn.sp@PAGEOFF]
	ldr	w1, [x8]
	ldr	x8, [x23, _rmtgetconn.pwd@PAGEOFF]
	ldr	x2, [x8]
Lloh15:
	adrp	x20, _rmtpeer@GOTPAGE
Lloh16:
	ldr	x20, [x20, _rmtpeer@GOTPAGEOFF]
Lloh17:
	adrp	x5, _errfd@GOTPAGE
Lloh18:
	ldr	x5, [x5, _errfd@GOTPAGEOFF]
	mov	x0, x20
	mov	x3, x19
	mov	x4, x21
	bl	_rcmd
Lloh19:
	adrp	x21, _rmtape@GOTPAGE
Lloh20:
	ldr	x21, [x21, _rmtape@GOTPAGEOFF]
	str	x0, [x21]
	tbnz	x0, #63, LBB0_15
; %bb.8:
Lloh21:
	adrp	x8, _stderr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	x2, [x20]
Lloh24:
	adrp	x1, l_.str.8@PAGE
Lloh25:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_fprintf
Lloh26:
	adrp	x8, _ntrec@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ntrec@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x19, _TP_BSIZE@GOTPAGE
Lloh30:
	ldr	x19, [x19, _TP_BSIZE@GOTPAGEOFF]
	ldr	w9, [x19]
	mul	w8, w9, w8
	mov	w10, #61440
	cmp	w8, #15, lsl #12                ; =61440
	csel	w8, w8, w10, lt
	add	w8, w8, #2048
	str	w8, [sp, #28]
Lloh31:
	adrp	x20, _SOL_SOCKET@GOTPAGE
Lloh32:
	ldr	x20, [x20, _SOL_SOCKET@GOTPAGEOFF]
	cmp	w8, w9
	b.le	LBB0_12
; %bb.9:
Lloh33:
	adrp	x22, _SO_SNDBUF@GOTPAGE
Lloh34:
	ldr	x22, [x22, _SO_SNDBUF@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	ldr	w1, [x20]
	ldr	w2, [x22]
	add	x3, sp, #28
	mov	w4, #4
	bl	_setsockopt
	tbz	x0, #63, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x19]
	ldr	w9, [sp, #28]
	sub	w9, w9, w8
	cmp	w9, w8
	str	w9, [sp, #28]
	b.gt	LBB0_10
LBB0_12:
	ldr	x0, [x21]
	ldr	w1, [x20]
Lloh35:
	adrp	x8, _SO_RCVBUF@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SO_RCVBUF@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	add	x3, sp, #28
	mov	w4, #4
	bl	_setsockopt
Lloh38:
	adrp	x8, _IPTOS_THROUGHPUT@GOTPAGE
Lloh39:
	ldr	x8, [x8, _IPTOS_THROUGHPUT@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	ldr	x0, [x21]
Lloh41:
	adrp	x8, _IPPROTO_IP@GOTPAGE
Lloh42:
	ldr	x8, [x8, _IPPROTO_IP@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
Lloh44:
	adrp	x8, _IP_TOS@GOTPAGE
Lloh45:
	ldr	x8, [x8, _IP_TOS@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
	add	x3, sp, #24
	mov	w4, #4
	bl	_setsockopt
	tbnz	x0, #63, LBB0_17
LBB0_13:
	mov	w8, #1
	str	w8, [sp, #20]
	ldr	x0, [x21]
Lloh47:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh48:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
Lloh50:
	adrp	x8, _TCP_NODELAY@GOTPAGE
Lloh51:
	ldr	x8, [x8, _TCP_NODELAY@GOTPAGEOFF]
Lloh52:
	ldr	w2, [x8]
	add	x3, sp, #20
	mov	w4, #4
	bl	_setsockopt
	tbz	x0, #63, LBB0_16
; %bb.14:
Lloh53:
	adrp	x0, l_.str.10@PAGE
Lloh54:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_perror
	b	LBB0_16
LBB0_15:
	ldr	x8, [x20]
	stp	x8, x19, [sp]
Lloh55:
	adrp	x0, l_.str.7@PAGE
Lloh56:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_msg
LBB0_16:
	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_17:
Lloh57:
	adrp	x0, l_.str.9@PAGE
Lloh58:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_perror
	b	LBB0_13
LBB0_18:
Lloh59:
	adrp	x0, l_.str.2@PAGE
Lloh60:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh61:
	adrp	x0, l_.str.3@PAGE
Lloh62:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_20:
	bl	_msg
LBB0_21:
Lloh63:
	adrp	x8, _X_STARTUP@GOTPAGE
Lloh64:
	ldr	x8, [x8, _X_STARTUP@GOTPAGEOFF]
Lloh65:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_rmtgetconn.sp,8,3 ; @rmtgetconn.sp
.zerofill __DATA,__bss,_rmtgetconn.pwd,8,3 ; @rmtgetconn.pwd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"shell"

l_.str.1:                               ; @.str.1
	.asciz	"tcp"

l_.str.2:                               ; @.str.2
	.asciz	"shell/tcp: unknown service\n"

	.comm	_X_STARTUP,4,2                  ; @X_STARTUP
l_.str.3:                               ; @.str.3
	.asciz	"who are you?\n"

	.comm	_rmtpeer,8,3                    ; @rmtpeer
l_.str.4:                               ; @.str.4
	.asciz	"RMT"

	.comm	__PATH_RMT,8,3                  ; @_PATH_RMT
l_.str.5:                               ; @.str.5
	.asciz	"%s"

l_.str.6:                               ; @.str.6
	.space	1

	.comm	_errfd,4,2                      ; @errfd
	.comm	_rmtape,8,3                     ; @rmtape
l_.str.7:                               ; @.str.7
	.asciz	"login to %s as %s failed.\n"

	.comm	_stderr,4,2                     ; @stderr
l_.str.8:                               ; @.str.8
	.asciz	"Connection to %s established.\n"

	.comm	_ntrec,4,2                      ; @ntrec
	.comm	_TP_BSIZE,4,2                   ; @TP_BSIZE
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_SNDBUF,4,2                  ; @SO_SNDBUF
	.comm	_SO_RCVBUF,4,2                  ; @SO_RCVBUF
	.comm	_IPTOS_THROUGHPUT,4,2           ; @IPTOS_THROUGHPUT
	.comm	_IPPROTO_IP,4,2                 ; @IPPROTO_IP
	.comm	_IP_TOS,4,2                     ; @IP_TOS
l_.str.9:                               ; @.str.9
	.asciz	"IP_TOS:IPTOS_THROUGHPUT setsockopt"

	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.comm	_TCP_NODELAY,4,2                ; @TCP_NODELAY
l_.str.10:                              ; @.str.10
	.asciz	"TCP_NODELAY setsockopt"

.subsections_via_symbols
