	.file	"318508.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Enter string: "
.LC1:
	.string	"\nEnter word to be searched: "
	.align 8
.LC2:
	.string	"\n'%s' is last occured at position %d."
.LC3:
	.string	"\n'%s' is not found."
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 216
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -216[rbp], 0
	mov	DWORD PTR -212[rbp], 0
	mov	DWORD PTR -208[rbp], 0
	mov	DWORD PTR -204[rbp], 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -128[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -192[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	mov	DWORD PTR -220[rbp], 0
	jmp	.L2
.L12:
	mov	eax, DWORD PTR -220[rbp]
	cdqe
	movzx	eax, BYTE PTR -128[rbp+rax]
	mov	BYTE PTR -221[rbp], al
	mov	eax, DWORD PTR -216[rbp]
	cdqe
	movzx	edx, BYTE PTR -221[rbp]
	mov	BYTE PTR -160[rbp+rax], dl
	cmp	BYTE PTR -221[rbp], 32
	je	.L3
	mov	eax, DWORD PTR -220[rbp]
	movsx	rbx, eax
	lea	rax, -128[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	cmp	rbx, rax
	jne	.L4
.L3:
	add	DWORD PTR -208[rbp], 1
	add	DWORD PTR -216[rbp], 1
	mov	eax, DWORD PTR -216[rbp]
	cdqe
	mov	BYTE PTR -160[rbp+rax], 0
	jmp	.L5
.L9:
	mov	eax, DWORD PTR -212[rbp]
	cdqe
	movzx	edx, BYTE PTR -192[rbp+rax]
	mov	eax, DWORD PTR -212[rbp]
	cdqe
	movzx	eax, BYTE PTR -160[rbp+rax]
	cmp	dl, al
	jne	.L6
	mov	DWORD PTR -204[rbp], 1
	jmp	.L17
.L6:
	mov	DWORD PTR -204[rbp], 0
	jmp	.L8
.L17:
	add	DWORD PTR -212[rbp], 1
.L5:
	mov	eax, DWORD PTR -212[rbp]
	cdqe
	movzx	eax, BYTE PTR -192[rbp+rax]
	test	al, al
	jne	.L9
.L8:
	cmp	DWORD PTR -204[rbp], 1
	jne	.L10
	mov	DWORD PTR -200[rbp], 1
	mov	eax, DWORD PTR -208[rbp]
	mov	DWORD PTR -196[rbp], eax
.L10:
	mov	DWORD PTR -216[rbp], 0
	mov	DWORD PTR -212[rbp], 0
	jmp	.L11
.L4:
	add	DWORD PTR -216[rbp], 1
.L11:
	add	DWORD PTR -220[rbp], 1
.L2:
	mov	eax, DWORD PTR -220[rbp]
	movsx	rbx, eax
	lea	rax, -128[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rbx, rax
	jb	.L12
	cmp	DWORD PTR -200[rbp], 1
	jne	.L13
	mov	edx, DWORD PTR -196[rbp]
	lea	rax, -192[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L14
.L13:
	lea	rax, -192[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L14:
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"318508.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Enter string: \000"
	.align	2
.LC1:
	.ascii	"\012Enter word to be searched: \000"
	.align	2
.LC2:
	.ascii	"\012'%s' is last occured at position %d.\000"
	.align	2
.LC3:
	.ascii	"\012'%s' is not found.\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 = 176
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #176
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-172]
	mov	r3, #0
	str	r3, [fp, #-168]
	mov	r3, #0
	str	r3, [fp, #-164]
	mov	r3, #0
	str	r3, [fp, #-160]
	ldr	r0, .L18+4
	bl	printf
	sub	r3, fp, #108
	mov	r0, r3
	bl	gets
	ldr	r0, .L18+8
	bl	printf
	sub	r3, fp, #148
	mov	r0, r3
	bl	gets
	mov	r3, #0
	str	r3, [fp, #-176]
	b	.L2
.L12:
	sub	r2, fp, #108
	ldr	r3, [fp, #-176]
	add	r3, r2, r3
	ldrb	r3, [r3]
	strb	r3, [fp, #-177]
	sub	r2, fp, #128
	ldr	r3, [fp, #-172]
	add	r3, r2, r3
	ldrb	r2, [fp, #-177]
	strb	r2, [r3]
	ldrb	r3, [fp, #-177]	@ zero_extendqisi2
	cmp	r3, #32
	beq	.L3
	sub	r3, fp, #108
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r2, r3, #1
	ldr	r3, [fp, #-176]
	cmp	r2, r3
	bne	.L4
.L3:
	ldr	r3, [fp, #-164]
	add	r3, r3, #1
	str	r3, [fp, #-164]
	ldr	r3, [fp, #-172]
	add	r3, r3, #1
	str	r3, [fp, #-172]
	sub	r2, fp, #128
	ldr	r3, [fp, #-172]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	b	.L5
.L9:
	sub	r2, fp, #148
	ldr	r3, [fp, #-168]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	sub	r1, fp, #128
	ldr	r3, [fp, #-168]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L6
	mov	r3, #1
	str	r3, [fp, #-160]
	b	.L17
.L6:
	mov	r3, #0
	str	r3, [fp, #-160]
	b	.L8
.L17:
	ldr	r3, [fp, #-168]
	add	r3, r3, #1
	str	r3, [fp, #-168]
.L5:
	sub	r2, fp, #148
	ldr	r3, [fp, #-168]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L9
.L8:
	ldr	r3, [fp, #-160]
	cmp	r3, #1
	bne	.L10
	mov	r3, #1
	str	r3, [fp, #-156]
	ldr	r3, [fp, #-164]
	str	r3, [fp, #-152]
.L10:
	mov	r3, #0
	str	r3, [fp, #-172]
	mov	r3, #0
	str	r3, [fp, #-168]
	b	.L11
.L4:
	ldr	r3, [fp, #-172]
	add	r3, r3, #1
	str	r3, [fp, #-172]
.L11:
	ldr	r3, [fp, #-176]
	add	r3, r3, #1
	str	r3, [fp, #-176]
.L2:
	sub	r3, fp, #108
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-176]
	cmp	r2, r3
	bhi	.L12
	ldr	r3, [fp, #-156]
	cmp	r3, #1
	bne	.L13
	sub	r3, fp, #148
	ldr	r2, [fp, #-152]
	mov	r1, r3
	ldr	r0, .L18+12
	bl	printf
	b	.L14
.L13:
	sub	r3, fp, #148
	mov	r1, r3
	ldr	r0, .L18+16
	bl	printf
.L14:
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC4
	.word	.LC0
	.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
