	.file	"701153.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Error occured with pipe operation."
.LC1:
	.string	"Error ocurred with fork."
.LC2:
	.string	"Enter a word : "
.LC3:
	.string	"%[^\n]"
.LC4:
	.string	"Error ocurred while Writing."
.LC5:
	.string	"Error ocurred while Reading."
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -40[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L9
.L2:
	call	fork@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], -1
	jne	.L4
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 2
	jmp	.L9
.L4:
	cmp	DWORD PTR -44[rbp], 0
	jne	.L5
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -36[rbp]
	lea	rcx, -32[rbp]
	mov	edx, 20
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 4
	jmp	.L9
.L6:
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L7
.L5:
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -40[rbp]
	lea	rcx, -32[rbp]
	mov	edx, 20
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, -1
	jne	.L8
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 5
	jmp	.L9
.L8:
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	reverse_string
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	close@PLT
.L7:
	mov	eax, 0
.L9:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"Reversed string is : "
	.text
	.globl	reverse_string
	.type	reverse_string, @function
reverse_string:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -8[rbp], eax
	mov	DWORD PTR -4[rbp], 0
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -9[rbp], al
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -9[rbp]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -4[rbp], 1
	sub	DWORD PTR -8[rbp], 1
.L12:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jl	.L13
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	reverse_string, .-reverse_string
	.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	"701153.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error occured with pipe operation.\000"
	.align	2
.LC1:
	.ascii	"Error ocurred with fork.\000"
	.align	2
.LC2:
	.ascii	"Enter a word : \000"
	.align	2
.LC3:
	.ascii	"%[^\012]\000"
	.align	2
.LC4:
	.ascii	"Error ocurred while Writing.\000"
	.align	2
.LC5:
	.ascii	"Error ocurred while Reading.\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #36
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L11+4
	bl	puts
	mov	r3, #1
	b	.L9
.L2:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L11+8
	bl	puts
	mov	r3, #2
	b	.L9
.L4:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L5
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	close
	ldr	r0, .L11+12
	bl	printf
	sub	r3, fp, #28
	mov	r1, r3
	ldr	r0, .L11+16
	bl	__isoc99_scanf
	ldr	r3, [fp, #-32]
	sub	r1, fp, #28
	mov	r2, #20
	mov	r0, r3
	bl	write
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L11+20
	bl	puts
	mov	r3, #4
	b	.L9
.L6:
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	close
	b	.L7
.L5:
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-36]
	sub	r1, fp, #28
	mov	r2, #20
	mov	r0, r3
	bl	read
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L11+24
	bl	puts
	mov	r3, #5
	b	.L9
.L8:
	sub	r3, fp, #28
	mov	r0, r3
	bl	reverse_string
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	close
.L7:
	mov	r3, #0
.L9:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Reversed string is : \000"
	.text
	.align	2
	.global	reverse_string
	.syntax unified
	.arm
	.fpu softvfp
	.type	reverse_string, %function
reverse_string:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r0, [fp, #-24]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L14
.L15:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r3, [r3]
	strb	r3, [fp, #-13]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r2, [fp, #-13]
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L14:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	blt	.L15
	ldr	r0, .L16
	bl	printf
	ldr	r0, [fp, #-24]
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC7
	.size	reverse_string, .-reverse_string
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
