	.file	"924540.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"$$ "
	.text
	.globl	getinput
	.type	getinput, @function
getinput:
.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	QWORD PTR -16[rbp], rsi
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR stdin[rip]
	mov	rax, QWORD PTR -16[rbp]
	mov	ecx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	fgets@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getinput, .-getinput
	.section	.rodata
.LC1:
	.string	"shell: can't fork: %s\n"
.LC2:
	.string	"shell: couldn't exec %s: %s\n"
.LC3:
	.string	"shell: waitpid error: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	QWORD PTR -1072[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	jmp	.L4
.L7:
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -1040[rbp+rax], 0
	call	fork@PLT
	mov	DWORD PTR -1044[rbp], eax
	cmp	DWORD PTR -1044[rbp], -1
	jne	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L4
.L5:
	cmp	DWORD PTR -1044[rbp], 0
	jne	.L6
	lea	rcx, -1040[rbp]
	lea	rax, -1040[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	execlp@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -1040[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 65
	call	exit@PLT
.L6:
	lea	rcx, -1048[rbp]
	mov	eax, DWORD PTR -1044[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	mov	DWORD PTR -1044[rbp], eax
	cmp	DWORD PTR -1044[rbp], 0
	jns	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L4:
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	getinput
	test	rax, rax
	jne	.L7
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.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	"924540.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"$$ \000"
	.text
	.align	2
	.global	getinput
	.syntax unified
	.arm
	.fpu softvfp
	.type	getinput, %function
getinput:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r0, .L3
	bl	printf
	ldr	r3, [fp, #-12]
	ldr	r2, .L3+4
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	fgets
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC0
	.word	stdin
	.size	getinput, .-getinput
	.section	.rodata
	.align	2
.LC1:
	.ascii	"shell: can't fork: %s\012\000"
	.align	2
.LC2:
	.ascii	"shell: couldn't exec %s: %s\012\000"
	.align	2
.LC3:
	.ascii	"shell: waitpid error: %s\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #1040
	sub	sp, sp, #12
	str	r0, [fp, #-1056]
	str	r1, [fp, #-1060]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	b	.L6
.L9:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-1028]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmn	r3, #1
	bne	.L7
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+8
	mov	r0, r4
	bl	fprintf
	b	.L6
.L7:
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bne	.L8
	sub	r1, fp, #1024
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #0
	mov	r0, r3
	bl	execlp
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	sub	r2, fp, #1024
	sub	r2, r2, #12
	sub	r2, r2, #4
	ldr	r1, .L11+12
	mov	r0, r4
	bl	fprintf
	mov	r0, #65
	bl	exit
.L8:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-1044]
	bl	waitpid
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bge	.L6
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+16
	mov	r0, r4
	bl	fprintf
.L6:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	getinput
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	mov	r0, #0
	bl	exit
.L12:
	.align	2
.L11:
	.word	.LC4
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
