	.file	"extr_rsh.c_proto.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"getsockname(%s)"
.LC1:
	.string	"getpeername(%s)"
.LC2:
	.string	"getsockname"
.LC3:
	.string	"listen"
.LC4:
	.string	"%u"
.LC5:
	.string	"write"
.LC6:
	.string	"fd too large"
.LC7:
	.string	"select"
.LC8:
	.string	"accept"
.LC9:
	.string	"socket closed"
.LC10:
	.string	"0"
.LC11:
	.string	"read"
.LC12:
	.string	"unexpected EOF from %s"
.LC13:
	.string	"Error from rshd at %s:"
.LC14:
	.string	"\n"
.LC15:
	.string	"setsockopt remote"
.LC16:
	.string	"setsockopt stderr"
	.text
	.p2align 4
	.type	proto, @function
proto:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13d, esi
	push	r12
	.cfi_offset 12, -48
	mov	r12d, edi
	push	rbx
	sub	rsp, 104
	.cfi_offset 3, -56
	mov	rax, QWORD PTR 24[rbp]
	mov	QWORD PTR -88[rbp], rdx
	mov	QWORD PTR -96[rbp], rcx
	mov	rcx, rsp
	mov	QWORD PTR -104[rbp], r8
	mov	QWORD PTR -112[rbp], r9
	mov	QWORD PTR -120[rbp], rax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR BUFSIZ[rip]
	mov	rbx, rax
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L48:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L48
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L49
.L4:
	lea	rax, -76[rbp]
	lea	r14, -64[rbp]
	mov	edi, r12d
	mov	QWORD PTR -144[rbp], rsp
	mov	rdx, r14
	mov	rsi, rax
	mov	DWORD PTR -64[rbp], 4
	mov	QWORD PTR -136[rbp], rax
	call	getsockname@PLT
	test	rax, rax
	js	.L50
	lea	r15, -72[rbp]
	mov	rdx, r14
	mov	edi, r12d
	mov	DWORD PTR -64[rbp], 4
	mov	rsi, r15
	call	getpeername@PLT
	test	rax, rax
	js	.L51
	cmp	r13d, -1
	je	.L8
	lea	r8, -68[rbp]
	mov	rdx, r14
	mov	edi, r13d
	mov	DWORD PTR -64[rbp], 4
	mov	rsi, r8
	mov	QWORD PTR -128[rbp], r8
	call	getsockname@PLT
	mov	r8, QWORD PTR -128[rbp]
	test	rax, rax
	js	.L52
	mov	esi, 1
	mov	edi, r13d
	mov	QWORD PTR -128[rbp], r8
	call	listen@PLT
	mov	r8, QWORD PTR -128[rbp]
	test	rax, rax
	js	.L53
	mov	rdi, r8
	call	socket_get_port@PLT
	mov	edi, eax
	call	ntohs@PLT
	lea	rdx, .LC4[rip]
	mov	esi, ebx
	mov	rdi, rsp
	mov	ecx, eax
	call	snprintf@PLT
	mov	rdi, rsp
	call	strlen@PLT
	mov	rsi, rsp
	mov	edi, r12d
	lea	r14d, 1[rax]
	mov	edx, r14d
	call	net_write@PLT
	cmp	r14d, eax
	jne	.L11
	cmp	r12d, r13d
	mov	eax, r13d
	lea	r14, -60[rbp]
	cmovge	eax, r12d
	mov	DWORD PTR -128[rbp], eax
.L12:
	mov	eax, DWORD PTR -128[rbp]
	cmp	DWORD PTR FD_SETSIZE[rip], eax
	jg	.L13
	lea	rsi, .LC6[rip]
	mov	edi, 1
	call	errx@PLT
.L13:
	mov	rdi, r14
	call	FD_ZERO@PLT
	mov	rsi, r14
	mov	edi, r13d
	call	FD_SET@PLT
	mov	rsi, r14
	mov	edi, r12d
	call	FD_SET@PLT
	mov	esi, r12d
	mov	edi, r13d
	call	max@PLT
	xor	r8d, r8d
	xor	ecx, ecx
	xor	edx, edx
	lea	rdi, 1[rax]
	mov	rsi, r14
	call	select@PLT
	test	eax, eax
	jns	.L14
	mov	rax, QWORD PTR EINTR[rip]
	cmp	QWORD PTR errno[rip], rax
	je	.L12
	lea	rdi, .LC7[rip]
	xor	eax, eax
	call	warn@PLT
	mov	edi, r13d
	call	close@PLT
.L45:
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L50:
	mov	rsi, QWORD PTR -88[rbp]
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	warn@PLT
	mov	eax, 1
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L54
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	edx, 2
	lea	rsi, .LC10[rip]
	mov	edi, r12d
	call	net_write@PLT
	cmp	eax, 2
	jne	.L55
.L20:
	push	QWORD PTR -112[rbp]
	mov	rcx, QWORD PTR -88[rbp]
	mov	rdx, r15
	mov	edi, r12d
	mov	r9, QWORD PTR -96[rbp]
	push	QWORD PTR 16[rbp]
	mov	r8, QWORD PTR -104[rbp]
	mov	rsi, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR -120[rbp]
	call	rax
	pop	rdx
	pop	rcx
	test	eax, eax
	jne	.L46
	lea	rsi, -77[rbp]
	mov	edx, 1
	mov	edi, r12d
	call	net_read@PLT
	test	eax, eax
	js	.L56
	je	.L57
	cmp	BYTE PTR -77[rbp], 0
	jne	.L58
	cmp	QWORD PTR sock_debug[rip], 0
	jne	.L59
.L27:
	mov	esi, r13d
	mov	edi, r12d
	call	rsh_loop@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L49:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	lea	rdi, .LC5[rip]
.L44:
	xor	eax, eax
	call	warn@PLT
	mov	edi, r13d
	call	close@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L55:
	lea	rdi, .LC5[rip]
	xor	eax, eax
	call	warn@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rsi, r14
	mov	edi, r13d
	call	FD_ISSET@PLT
	test	rax, rax
	jne	.L60
	mov	rsi, r14
	mov	edi, r12d
	call	FD_ISSET@PLT
	test	rax, rax
	je	.L12
	lea	rdi, .LC9[rip]
	xor	eax, eax
	call	warnx@PLT
	mov	edi, r13d
	mov	r13d, -1
	call	close@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L51:
	mov	rsi, QWORD PTR -88[rbp]
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	warn@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L52:
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	warn@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L53:
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	warn@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L57:
	mov	rsi, QWORD PTR -88[rbp]
	lea	rdi, .LC12[rip]
	xor	eax, eax
	call	warnx@PLT
.L46:
	mov	edi, r13d
	call	close@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L59:
	lea	r14, -60[rbp]
	mov	edx, DWORD PTR SO_DEBUG[rip]
	mov	esi, DWORD PTR SOL_SOCKET[rip]
	mov	r8d, 4
	mov	rcx, r14
	mov	edi, r12d
	mov	DWORD PTR -60[rbp], 1
	call	setsockopt@PLT
	test	rax, rax
	js	.L61
.L28:
	cmp	r13d, -1
	je	.L27
	mov	edx, DWORD PTR SO_DEBUG[rip]
	mov	esi, DWORD PTR SOL_SOCKET[rip]
	mov	rcx, r14
	mov	edi, r13d
	mov	r8d, 4
	call	setsockopt@PLT
	test	rax, rax
	jns	.L27
	lea	rdi, .LC16[rip]
	xor	eax, eax
	call	warn@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L56:
	lea	rdi, .LC11[rip]
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L58:
	mov	rsi, QWORD PTR -88[rbp]
	lea	rdi, .LC13[rip]
	xor	eax, eax
	call	warnx@PLT
	mov	r14, QWORD PTR -144[rbp]
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	mov	edi, DWORD PTR STDOUT_FILENO[rip]
	mov	rsi, r14
	call	write@PLT
.L25:
	mov	edx, ebx
	mov	rsi, r14
	mov	edi, r12d
	call	read@PLT
	mov	edx, eax
	test	eax, eax
	jg	.L26
	mov	edi, DWORD PTR STDOUT_FILENO[rip]
	mov	edx, 1
	lea	rsi, .LC14[rip]
	call	write@PLT
	mov	edi, r13d
	call	close@PLT
	mov	eax, 1
	jmp	.L1
.L60:
	mov	edi, r13d
	xor	edx, edx
	xor	esi, esi
	call	accept@PLT
	mov	edi, r13d
	mov	r14d, eax
	call	close@PLT
	mov	r13d, r14d
	test	r14d, r14d
	jns	.L20
	lea	rdi, .LC8[rip]
	xor	eax, eax
	call	warn@PLT
	jmp	.L45
.L61:
	lea	rdi, .LC15[rip]
	xor	eax, eax
	call	warn@PLT
	jmp	.L28
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	proto, .-proto
	.comm	sock_debug,8,8
	.comm	errno,8,8
	.comm	STDOUT_FILENO,4,4
	.comm	SO_DEBUG,4,4
	.comm	SOL_SOCKET,4,4
	.comm	FD_SETSIZE,4,4
	.comm	EINTR,8,8
	.comm	BUFSIZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rsh.c_proto.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"getsockname(%s)\000"
	.align	2
.LC1:
	.ascii	"getpeername(%s)\000"
	.align	2
.LC2:
	.ascii	"getsockname\000"
	.align	2
.LC3:
	.ascii	"listen\000"
	.align	2
.LC4:
	.ascii	"%u\000"
	.align	2
.LC5:
	.ascii	"write\000"
	.align	2
.LC6:
	.ascii	"fd too large\000"
	.align	2
.LC7:
	.ascii	"select\000"
	.align	2
.LC8:
	.ascii	"accept\000"
	.align	2
.LC9:
	.ascii	"socket closed\000"
	.align	2
.LC10:
	.ascii	"0\000"
	.align	2
.LC11:
	.ascii	"read\000"
	.align	2
.LC12:
	.ascii	"unexpected EOF from %s\000"
	.align	2
.LC13:
	.ascii	"Error from rshd at %s:\000"
	.align	2
.LC14:
	.ascii	"\012\000"
	.align	2
.LC15:
	.ascii	"setsockopt remote\000"
	.align	2
.LC16:
	.ascii	"setsockopt stderr\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	proto, %function
proto:
	@ args = 16, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #76
	mov	r7, #4
	str	r3, [fp, #-72]
	ldr	r3, .L56
	mov	r6, r2
	ldr	r2, .L56+4
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r3, [fp, #4]
	ldr	r8, [r2]
	str	r3, [fp, #-76]
	ldr	r3, [fp, #8]
	add	r2, r8, #7
	bic	r2, r2, #7
	str	r3, [fp, #-80]
	ldr	r3, [fp, #16]
	sub	sp, sp, r2
	mov	r4, r1
	sub	r2, fp, #48
	sub	r1, fp, #60
	mov	r5, r0
	str	r7, [fp, #-48]
	str	r3, [fp, #-84]
	bl	getsockname
	cmp	r0, #0
	blt	.L44
	mov	r0, r5
	sub	r1, fp, #56
	sub	r2, fp, #48
	str	r7, [fp, #-48]
	bl	getpeername
	cmp	r0, #0
	blt	.L45
	cmn	r4, #1
	add	r9, sp, #16
	beq	.L5
	mov	r0, r4
	sub	r2, fp, #48
	sub	r1, fp, #52
	str	r7, [fp, #-48]
	bl	getsockname
	cmp	r0, #0
	blt	.L46
	mov	r1, #1
	mov	r0, r4
	bl	listen
	cmp	r0, #0
	blt	.L47
	sub	r0, fp, #52
	bl	socket_get_port
	bl	ntohs
	mov	r1, r8
	mov	r3, r0
	ldr	r2, .L56+8
	mov	r0, r9
	bl	snprintf
	mov	r0, r9
	bl	strlen
	add	r7, r0, #1
	mov	r2, r7
	mov	r1, r9
	mov	r0, r5
	bl	net_write
	cmp	r7, r0
	bne	.L8
	cmp	r5, r4
	movge	r3, r5
	movlt	r3, r4
	sub	r7, fp, #44
	str	r3, [fp, #-88]
.L9:
	ldr	r3, .L56+12
	ldr	r2, [fp, #-88]
	ldr	r3, [r3]
	cmp	r3, r2
	bgt	.L10
	mov	r0, #1
	ldr	r1, .L56+16
	bl	errx
.L10:
	mov	r0, r7
	bl	FD_ZERO
	mov	r1, r7
	mov	r0, r4
	bl	FD_SET
	mov	r1, r7
	mov	r0, r5
	bl	FD_SET
	mov	r1, r5
	mov	r0, r4
	bl	max
	mov	r10, #0
	mov	r1, r7
	mov	r3, r10
	mov	r2, r10
	add	r0, r0, #1
	str	r10, [sp]
	bl	select
	cmp	r0, r10
	bge	.L11
	ldr	r3, .L56+20
	ldr	r2, [r3]
	ldr	r3, .L56+24
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L9
	ldr	r0, .L56+28
	bl	warn
	mov	r0, r4
	bl	close
.L41:
	mov	r0, #1
	b	.L1
.L5:
	mov	r2, #2
	mov	r0, r5
	ldr	r1, .L56+32
	bl	net_write
	cmp	r0, #2
	bne	.L48
.L17:
	ldr	r3, [fp, #-80]
	mov	r0, r5
	str	r3, [sp, #12]
	ldr	r3, [fp, #12]
	ldr	ip, [fp, #-84]
	str	r3, [sp, #8]
	ldr	r3, [fp, #-72]
	sub	r2, fp, #56
	str	r3, [sp, #4]
	ldr	r3, [fp, #-76]
	sub	r1, fp, #60
	str	r3, [sp]
	mov	r3, r6
	blx	ip
	cmp	r0, #0
	bne	.L42
	mov	r2, #1
	mov	r0, r5
	sub	r1, fp, #61
	bl	net_read
	cmp	r0, #0
	blt	.L49
	beq	.L50
	ldrb	r3, [fp, #-61]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L51
	ldr	r3, .L56+36
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L52
.L24:
	mov	r1, r4
	mov	r0, r5
	bl	rsh_loop
	b	.L1
.L44:
	mov	r1, r6
	ldr	r0, .L56+40
	bl	warn
	mov	r0, #1
.L1:
	ldr	r3, .L56
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L53
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	ldr	r0, .L56+44
	bl	warn
	mov	r0, r4
	bl	close
	mov	r0, #1
	b	.L1
.L48:
	ldr	r0, .L56+44
	bl	warn
	mov	r0, #1
	b	.L1
.L11:
	mov	r1, r7
	mov	r0, r4
	bl	FD_ISSET
	cmp	r0, #0
	bne	.L54
	mov	r1, r7
	mov	r0, r5
	bl	FD_ISSET
	cmp	r0, #0
	beq	.L9
	ldr	r0, .L56+48
	bl	warnx
	mov	r0, r4
	bl	close
	mvn	r4, #0
	b	.L17
.L45:
	mov	r1, r6
	ldr	r0, .L56+52
	bl	warn
	mov	r0, #1
	b	.L1
.L46:
	ldr	r0, .L56+56
	bl	warn
	mov	r0, #1
	b	.L1
.L47:
	ldr	r0, .L56+60
	bl	warn
	mov	r0, #1
	b	.L1
.L50:
	mov	r1, r6
	ldr	r0, .L56+64
	bl	warnx
.L42:
	mov	r0, r4
	bl	close
	b	.L41
.L52:
	mov	r3, #4
	mov	ip, #1
	ldr	r8, .L56+68
	ldr	r6, .L56+72
	str	r3, [sp]
	sub	r7, fp, #44
	mov	r3, r7
	mov	r0, r5
	ldr	r2, [r8]
	ldr	r1, [r6]
	str	ip, [fp, #-44]
	bl	setsockopt
	cmp	r0, #0
	blt	.L55
.L25:
	cmn	r4, #1
	beq	.L24
	mov	r0, #4
	ldr	r2, [r8]
	ldr	r1, [r6]
	mov	r3, r7
	str	r0, [sp]
	mov	r0, r4
	bl	setsockopt
	cmp	r0, #0
	bge	.L24
	ldr	r0, .L56+76
	bl	warn
	b	.L24
.L49:
	ldr	r0, .L56+80
	bl	warn
	mov	r0, r4
	bl	close
	mov	r0, #1
	b	.L1
.L51:
	mov	r1, r6
	ldr	r0, .L56+84
	bl	warnx
	ldr	r6, .L56+88
	b	.L22
.L23:
	mov	r1, r9
	ldr	r0, [r6]
	bl	write
.L22:
	mov	r2, r8
	mov	r1, r9
	mov	r0, r5
	bl	read
	subs	r2, r0, #0
	bgt	.L23
	mov	r2, #1
	ldr	r1, .L56+92
	ldr	r0, [r6]
	bl	write
	mov	r0, r4
	bl	close
	mov	r0, #1
	b	.L1
.L54:
	mov	r2, r10
	mov	r1, r10
	mov	r0, r4
	bl	accept
	mov	r7, r0
	mov	r0, r4
	bl	close
	cmp	r7, #0
	movge	r4, r7
	bge	.L17
	ldr	r0, .L56+96
	bl	warn
	b	.L41
.L55:
	ldr	r0, .L56+100
	bl	warn
	b	.L25
.L53:
	bl	__stack_chk_fail
.L57:
	.align	2
.L56:
	.word	.LC17
	.word	BUFSIZ
	.word	.LC4
	.word	FD_SETSIZE
	.word	.LC6
	.word	errno
	.word	EINTR
	.word	.LC7
	.word	.LC10
	.word	sock_debug
	.word	.LC0
	.word	.LC5
	.word	.LC9
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC12
	.word	SO_DEBUG
	.word	SOL_SOCKET
	.word	.LC16
	.word	.LC11
	.word	.LC13
	.word	STDOUT_FILENO
	.word	.LC14
	.word	.LC8
	.word	.LC15
	.size	proto, .-proto
	.comm	sock_debug,4,4
	.comm	errno,4,4
	.comm	STDOUT_FILENO,4,4
	.comm	SO_DEBUG,4,4
	.comm	SOL_SOCKET,4,4
	.comm	FD_SETSIZE,4,4
	.comm	EINTR,4,4
	.comm	BUFSIZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
