	.file	"766012.c"
	.intel_syntax noprefix
	.text
	.globl	detectLoop
	.type	detectLoop, @function
detectLoop:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L2
.L5:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jne	.L2
	mov	eax, 1
	jmp	.L3
.L2:
	cmp	QWORD PTR -16[rbp], 0
	je	.L4
	cmp	QWORD PTR -8[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L5
.L4:
	mov	eax, 0
.L3:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	detectLoop, .-detectLoop
	.globl	removeLoopIterative
	.type	removeLoopIterative, @function
removeLoopIterative:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
.L7:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	cmp	rax, QWORD PTR -16[rbp]
	jne	.L7
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	QWORD PTR -16[rbp], rax
	jne	.L8
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
.L9:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	rdx, rax
	jne	.L10
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], 0
	jmp	.L6
.L8:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
.L12:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	cmp	rdx, rax
	jne	.L13
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], 0
.L6:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	removeLoopIterative, .-removeLoopIterative
	.globl	removeLoopRecursive
	.type	removeLoopRecursive, @function
removeLoopRecursive:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	removeLoopRecursive, .-removeLoopRecursive
	.section	.rodata
.LC0:
	.string	"\nLinked List --> "
.LC1:
	.string	"%d -> "
.LC2:
	.string	"NULL"
	.text
	.globl	printList
	.type	printList, @function
printList:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
.L16:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L17
	lea	rdi, .LC2[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	printList, .-printList
	.globl	newNode
	.type	newNode, @function
newNode:
.LFB10:
	.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	DWORD PTR -20[rbp], edi
	mov	edi, 16
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	newNode, .-newNode
	.section	.rodata
.LC3:
	.string	"Before making loop...."
.LC4:
	.string	"Loop Detected = "
.LC5:
	.string	"TRUE\n"
.LC6:
	.string	"FALSE\n"
.LC7:
	.string	"After making loop...."
	.align 8
.LC8:
	.string	"Removing loop using iterative approach...."
	.align 8
.LC9:
	.string	"Linked List after removing loop....."
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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, 24
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	edi, 1
	call	newNode
	mov	QWORD PTR -32[rbp], rax
	mov	rbx, QWORD PTR -32[rbp]
	mov	edi, 2
	call	newNode
	mov	QWORD PTR 8[rbx], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR 8[rax]
	mov	edi, 3
	call	newNode
	mov	QWORD PTR 8[rbx], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rbx, QWORD PTR 8[rax]
	mov	edi, 4
	call	newNode
	mov	QWORD PTR 8[rbx], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	rbx, QWORD PTR 8[rax]
	mov	edi, 5
	call	newNode
	mov	QWORD PTR 8[rbx], rax
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	detectLoop
	test	eax, eax
	je	.L21
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L22
.L21:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L22:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR 8[rdx]
	mov	QWORD PTR 8[rax], rdx
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	detectLoop
	test	eax, eax
	je	.L23
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L24
.L23:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L24:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	removeLoopIterative
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	printList
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"766012.c"
	.text
	.align	2
	.global	detectLoop
	.syntax unified
	.arm
	.fpu softvfp
	.type	detectLoop, %function
detectLoop:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	b	.L2
.L5:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bne	.L2
	mov	r3, #1
	b	.L3
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L5
.L4:
	mov	r3, #0
.L3:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	detectLoop, .-detectLoop
	.align	2
	.global	removeLoopIterative
	.syntax unified
	.arm
	.fpu softvfp
	.type	removeLoopIterative, %function
removeLoopIterative:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
.L7:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bne	.L7
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bne	.L8
	b	.L9
.L10:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
.L9:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L10
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #4]
	b	.L6
.L8:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	b	.L12
.L13:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
.L12:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	cmp	r2, r3
	bne	.L13
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #4]
.L6:
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	removeLoopIterative, .-removeLoopIterative
	.align	2
	.global	removeLoopRecursive
	.syntax unified
	.arm
	.fpu softvfp
	.type	removeLoopRecursive, %function
removeLoopRecursive:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	removeLoopRecursive, .-removeLoopRecursive
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012Linked List --> \000"
	.align	2
.LC1:
	.ascii	"%d -> \000"
	.align	2
.LC2:
	.ascii	"NULL\000"
	.text
	.align	2
	.global	printList
	.syntax unified
	.arm
	.fpu softvfp
	.type	printList, %function
printList:
	@ 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	r0, .L18
	bl	printf
	b	.L16
.L17:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L18+4
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
.L16:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L17
	ldr	r0, .L18+8
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	printList, .-printList
	.align	2
	.global	newNode
	.syntax unified
	.arm
	.fpu softvfp
	.type	newNode, %function
newNode:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	newNode, .-newNode
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Before making loop....\000"
	.align	2
.LC4:
	.ascii	"Loop Detected = \000"
	.align	2
.LC5:
	.ascii	"TRUE\012\000"
	.align	2
.LC6:
	.ascii	"FALSE\012\000"
	.align	2
.LC7:
	.ascii	"After making loop....\000"
	.align	2
.LC8:
	.ascii	"Removing loop using iterative approach....\000"
	.align	2
.LC9:
	.ascii	"Linked List after removing loop.....\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r0, #1
	bl	newNode
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r4, [fp, #-20]
	mov	r0, #2
	bl	newNode
	mov	r3, r0
	str	r3, [r4, #4]
	ldr	r3, [fp, #-20]
	ldr	r4, [r3, #4]
	mov	r0, #3
	bl	newNode
	mov	r3, r0
	str	r3, [r4, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	ldr	r4, [r3, #4]
	mov	r0, #4
	bl	newNode
	mov	r3, r0
	str	r3, [r4, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #4]
	ldr	r4, [r3, #4]
	mov	r0, #5
	bl	newNode
	mov	r3, r0
	str	r3, [r4, #4]
	ldr	r0, .L29+4
	bl	puts
	ldr	r0, .L29+8
	bl	printf
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	detectLoop
	mov	r3, r0
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L29+12
	bl	printf
	b	.L24
.L23:
	ldr	r0, .L29+16
	bl	printf
.L24:
	ldr	r3, [fp, #-20]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #4]
	ldr	r2, [r2, #4]
	str	r2, [r3, #4]
	ldr	r0, .L29+20
	bl	puts
	ldr	r0, .L29+8
	bl	printf
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	detectLoop
	mov	r3, r0
	cmp	r3, #0
	beq	.L25
	ldr	r0, .L29+12
	bl	printf
	b	.L26
.L25:
	ldr	r0, .L29+16
	bl	printf
.L26:
	ldr	r0, .L29+24
	bl	puts
	sub	r3, fp, #20
	mov	r0, r3
	bl	removeLoopIterative
	ldr	r0, .L29+28
	bl	printf
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	printList
	mov	r3, #0
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC10
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
