	.file	"509431.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"enter the no of tracks to be traveresed"
.LC1:
	.string	"%d'"
.LC2:
	.string	"enter the position of head"
.LC3:
	.string	"%d"
.LC4:
	.string	"enter the tracks"
.LC5:
	.string	"\nAverage header movements:%f"
	.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
	sub	rsp, 288
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -264[rbp], 0
	mov	eax, 0
	call	clrscr@PLT
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -284[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -288[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -256[rbp], 0
	mov	eax, DWORD PTR -288[rbp]
	mov	DWORD PTR -252[rbp], eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -280[rbp], 2
	jmp	.L2
.L3:
	lea	rdx, -256[rbp]
	mov	eax, DWORD PTR -280[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -280[rbp], 1
.L2:
	mov	eax, DWORD PTR -284[rbp]
	add	eax, 1
	cmp	DWORD PTR -280[rbp], eax
	jle	.L3
	mov	DWORD PTR -280[rbp], 0
	jmp	.L4
.L8:
	mov	DWORD PTR -276[rbp], 0
	jmp	.L5
.L7:
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	edx, DWORD PTR -256[rbp+rax*4]
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	cdqe
	mov	eax, DWORD PTR -256[rbp+rax*4]
	cmp	edx, eax
	jle	.L6
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	eax, DWORD PTR -256[rbp+rax*4]
	mov	DWORD PTR -260[rbp], eax
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	cdqe
	mov	edx, DWORD PTR -256[rbp+rax*4]
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	DWORD PTR -256[rbp+rax*4], edx
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	cdqe
	mov	edx, DWORD PTR -260[rbp]
	mov	DWORD PTR -256[rbp+rax*4], edx
.L6:
	add	DWORD PTR -276[rbp], 1
.L5:
	mov	eax, DWORD PTR -284[rbp]
	add	eax, 2
	sub	eax, DWORD PTR -280[rbp]
	sub	eax, 1
	cmp	DWORD PTR -276[rbp], eax
	jl	.L7
	add	DWORD PTR -280[rbp], 1
.L4:
	mov	eax, DWORD PTR -284[rbp]
	add	eax, 1
	cmp	DWORD PTR -280[rbp], eax
	jle	.L8
	mov	DWORD PTR -280[rbp], 0
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -280[rbp]
	cdqe
	mov	edx, DWORD PTR -256[rbp+rax*4]
	mov	eax, DWORD PTR -288[rbp]
	cmp	edx, eax
	jne	.L10
	mov	eax, DWORD PTR -280[rbp]
	mov	DWORD PTR -276[rbp], eax
.L10:
	add	DWORD PTR -280[rbp], 1
.L9:
	mov	eax, DWORD PTR -284[rbp]
	add	eax, 1
	cmp	DWORD PTR -280[rbp], eax
	jle	.L11
	mov	eax, DWORD PTR -280[rbp]
	mov	DWORD PTR -272[rbp], eax
	mov	DWORD PTR -268[rbp], 0
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	edx, DWORD PTR -256[rbp+rax*4]
	mov	eax, DWORD PTR -268[rbp]
	cdqe
	mov	DWORD PTR -96[rbp+rax*4], edx
	sub	DWORD PTR -276[rbp], 1
	add	DWORD PTR -268[rbp], 1
.L12:
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	eax, DWORD PTR -256[rbp+rax*4]
	test	eax, eax
	jne	.L13
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	edx, DWORD PTR -256[rbp+rax*4]
	mov	eax, DWORD PTR -268[rbp]
	cdqe
	mov	DWORD PTR -96[rbp+rax*4], edx
	mov	eax, DWORD PTR -272[rbp]
	add	eax, 1
	mov	DWORD PTR -268[rbp], eax
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -272[rbp]
	add	eax, 1
	cdqe
	mov	edx, DWORD PTR -256[rbp+rax*4]
	mov	eax, DWORD PTR -268[rbp]
	cdqe
	mov	DWORD PTR -96[rbp+rax*4], edx
	add	DWORD PTR -268[rbp], 1
	add	DWORD PTR -272[rbp], 1
.L14:
	mov	eax, DWORD PTR -284[rbp]
	add	eax, 1
	cmp	DWORD PTR -268[rbp], eax
	jle	.L15
	mov	DWORD PTR -276[rbp], 0
	jmp	.L16
.L19:
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	edx, DWORD PTR -96[rbp+rax*4]
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	cdqe
	mov	eax, DWORD PTR -96[rbp+rax*4]
	cmp	edx, eax
	jle	.L17
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	edx, DWORD PTR -96[rbp+rax*4]
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	cdqe
	mov	eax, DWORD PTR -96[rbp+rax*4]
	sub	edx, eax
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	DWORD PTR -176[rbp+rax*4], edx
	jmp	.L18
.L17:
	mov	eax, DWORD PTR -276[rbp]
	add	eax, 1
	cdqe
	mov	edx, DWORD PTR -96[rbp+rax*4]
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	eax, DWORD PTR -96[rbp+rax*4]
	sub	edx, eax
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	DWORD PTR -176[rbp+rax*4], edx
.L18:
	mov	eax, DWORD PTR -276[rbp]
	cdqe
	mov	eax, DWORD PTR -176[rbp+rax*4]
	add	DWORD PTR -264[rbp], eax
	add	DWORD PTR -276[rbp], 1
.L16:
	mov	eax, DWORD PTR -284[rbp]
	cmp	DWORD PTR -276[rbp], eax
	jle	.L19
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, DWORD PTR -264[rbp]
	mov	eax, DWORD PTR -284[rbp]
	pxor	xmm1, xmm1
	cvtsi2ss	xmm1, eax
	divss	xmm0, xmm1
	pxor	xmm2, xmm2
	cvtss2sd	xmm2, xmm0
	movq	rax, xmm2
	movq	xmm0, rax
	lea	rdi, .LC5[rip]
	mov	eax, 1
	call	printf@PLT
	mov	eax, 0
	call	getch@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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	"509431.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"enter the no of tracks to be traveresed\000"
	.align	2
.LC1:
	.ascii	"%d'\000"
	.align	2
.LC2:
	.ascii	"enter the position of head\000"
	.align	2
.LC3:
	.ascii	"%d\000"
	.align	2
.LC4:
	.ascii	"enter the tracks\000"
	.global	__aeabi_i2f
	.global	__aeabi_fdiv
	.global	__aeabi_f2d
	.align	2
.LC5:
	.ascii	"\012Average header movements:%f\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 = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #284
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-264]
	bl	clrscr
	ldr	r0, .L22+4
	bl	printf
	sub	r3, fp, #284
	mov	r1, r3
	ldr	r0, .L22+8
	bl	__isoc99_scanf
	ldr	r0, .L22+12
	bl	printf
	sub	r3, fp, #288
	mov	r1, r3
	ldr	r0, .L22+16
	bl	__isoc99_scanf
	mov	r3, #0
	str	r3, [fp, #-256]
	ldr	r3, [fp, #-288]
	str	r3, [fp, #-252]
	ldr	r0, .L22+20
	bl	printf
	mov	r3, #2
	str	r3, [fp, #-280]
	b	.L2
.L3:
	sub	r2, fp, #256
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L22+16
	bl	__isoc99_scanf
	ldr	r3, [fp, #-280]
	add	r3, r3, #1
	str	r3, [fp, #-280]
.L2:
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	ldr	r2, [fp, #-280]
	cmp	r2, r3
	ble	.L3
	mov	r3, #0
	str	r3, [fp, #-280]
	b	.L4
.L8:
	mov	r3, #0
	str	r3, [fp, #-276]
	b	.L5
.L7:
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-244]
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r3, [r3, #-244]
	cmp	r2, r3
	ble	.L6
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-244]
	str	r3, [fp, #-260]
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-244]
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-244]
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [fp, #-260]
	str	r2, [r3, #-244]
.L6:
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	str	r3, [fp, #-276]
.L5:
	ldr	r3, [fp, #-284]
	add	r2, r3, #2
	ldr	r3, [fp, #-280]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-276]
	cmp	r2, r3
	blt	.L7
	ldr	r3, [fp, #-280]
	add	r3, r3, #1
	str	r3, [fp, #-280]
.L4:
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	ldr	r2, [fp, #-280]
	cmp	r2, r3
	ble	.L8
	mov	r3, #0
	str	r3, [fp, #-280]
	b	.L9
.L11:
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-244]
	ldr	r3, [fp, #-288]
	cmp	r2, r3
	bne	.L10
	ldr	r3, [fp, #-280]
	str	r3, [fp, #-276]
.L10:
	ldr	r3, [fp, #-280]
	add	r3, r3, #1
	str	r3, [fp, #-280]
.L9:
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	ldr	r2, [fp, #-280]
	cmp	r2, r3
	ble	.L11
	ldr	r3, [fp, #-280]
	str	r3, [fp, #-272]
	mov	r3, #0
	str	r3, [fp, #-268]
	b	.L12
.L13:
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-244]
	ldr	r3, [fp, #-268]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-84]
	ldr	r3, [fp, #-276]
	sub	r3, r3, #1
	str	r3, [fp, #-276]
	ldr	r3, [fp, #-268]
	add	r3, r3, #1
	str	r3, [fp, #-268]
.L12:
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-244]
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-244]
	ldr	r3, [fp, #-268]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-84]
	ldr	r3, [fp, #-272]
	add	r3, r3, #1
	str	r3, [fp, #-268]
	b	.L14
.L15:
	ldr	r3, [fp, #-272]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-244]
	ldr	r3, [fp, #-268]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-84]
	ldr	r3, [fp, #-268]
	add	r3, r3, #1
	str	r3, [fp, #-268]
	ldr	r3, [fp, #-272]
	add	r3, r3, #1
	str	r3, [fp, #-272]
.L14:
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	ldr	r2, [fp, #-268]
	cmp	r2, r3
	ble	.L15
	mov	r3, #0
	str	r3, [fp, #-276]
	b	.L16
.L19:
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-84]
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r3, [r3, #-84]
	cmp	r2, r3
	ble	.L17
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-84]
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r3, [r3, #-84]
	sub	r2, r2, r3
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-164]
	b	.L18
.L17:
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-84]
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r3, [r3, #-84]
	sub	r2, r2, r3
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-164]
.L18:
	ldr	r3, [fp, #-276]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-164]
	ldr	r2, [fp, #-264]
	add	r3, r2, r3
	str	r3, [fp, #-264]
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	str	r3, [fp, #-276]
.L16:
	ldr	r3, [fp, #-284]
	ldr	r2, [fp, #-276]
	cmp	r2, r3
	ble	.L19
	ldr	r0, [fp, #-264]
	bl	__aeabi_i2f
	mov	r4, r0
	ldr	r3, [fp, #-284]
	mov	r0, r3
	bl	__aeabi_i2f
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	__aeabi_fdiv
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_f2d
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L22+24
	bl	printf
	bl	getch
	mov	r3, #0
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
