	.file	"54824617.c"
	.intel_syntax noprefix
	.text
	.globl	heapify
	.type	heapify, @function
heapify:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rax
	or	rax, 1
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rax
	or	rax, 1
	add	rax, 1
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 16[rax]
	sub	rax, 1
	cmp	QWORD PTR -24[rbp], rax
	ja	.L2
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -48[rbp]
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L2
	mov	rax, QWORD PTR -24[rbp]
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -48[rbp]
.L3:
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 16[rax]
	sub	rax, 1
	cmp	QWORD PTR -16[rbp], rax
	ja	.L4
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L4
	mov	rax, QWORD PTR -16[rbp]
	jmp	.L5
.L4:
	mov	rax, QWORD PTR -8[rbp]
.L5:
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	cmp	rax, QWORD PTR -48[rbp]
	je	.L7
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	sal	rax, 2
	add	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -48[rbp]
	sal	rax, 2
	add	rax, rcx
	mov	rsi, rdx
	mov	rdi, rax
	call	swap@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 16[rax]
	shr	rax
	sub	rax, 1
	cmp	QWORD PTR -8[rbp], rax
	ja	.L7
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	heapify
.L7:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	heapify, .-heapify
	.globl	buildHeap
	.type	buildHeap, @function
buildHeap:
.LFB8:
	.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	QWORD PTR -32[rbp], rsi
	mov	edi, 24
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	shr	rax
	sub	eax, 1
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	heapify
	sub	DWORD PTR -16[rbp], 1
.L9:
	cmp	DWORD PTR -16[rbp], 0
	jns	.L10
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	buildHeap, .-buildHeap
	.globl	heapSort
	.type	heapSort, @function
heapSort:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	buildHeap
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	sub	eax, 1
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
	jmp	.L13
.L14:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	call	swap@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	heapify
	sub	DWORD PTR -16[rbp], 1
.L13:
	cmp	DWORD PTR -16[rbp], 0
	jg	.L14
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	heapSort, .-heapSort
	.section	.rodata
	.align 8
.LC0:
	.string	"\n After applying the Heap Sort sorting algorithm the array is: "
.LC1:
	.string	"%d "
	.text
	.globl	main
	.type	main, @function
main:
.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, 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -96[rbp], 200
	mov	DWORD PTR -92[rbp], 190
	mov	DWORD PTR -88[rbp], 10
	mov	DWORD PTR -84[rbp], -1
	mov	DWORD PTR -80[rbp], 29
	mov	DWORD PTR -76[rbp], 24
	mov	DWORD PTR -72[rbp], 3
	mov	DWORD PTR -68[rbp], 120
	mov	DWORD PTR -64[rbp], 31
	mov	DWORD PTR -60[rbp], 2
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -52[rbp], 9
	mov	DWORD PTR -48[rbp], 21
	mov	DWORD PTR -44[rbp], 2
	mov	DWORD PTR -40[rbp], 65
	mov	DWORD PTR -36[rbp], 4
	mov	DWORD PTR -32[rbp], 7
	mov	DWORD PTR -28[rbp], 1
	mov	DWORD PTR -24[rbp], -9
	mov	DWORD PTR -20[rbp], 2
	lea	rax, -96[rbp]
	mov	QWORD PTR -104[rbp], rax
	mov	rax, QWORD PTR -104[rbp]
	mov	esi, 20
	mov	rdi, rax
	call	heapSort
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	QWORD PTR -112[rbp], 0
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR -96[rbp+rax*4]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	QWORD PTR -112[rbp], 1
.L16:
	cmp	QWORD PTR -112[rbp], 19
	jbe	.L17
	mov	edi, 10
	call	putchar@PLT
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"54824617.c"
	.text
	.align	2
	.global	heapify
	.syntax unified
	.arm
	.fpu softvfp
	.type	heapify, %function
heapify:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #1
	orr	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #1
	orr	r3, r3, #1
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	sub	r3, r3, #1
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bhi	.L2
	ldr	r3, [fp, #-24]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	ldr	r1, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L2
	ldr	r3, [fp, #-16]
	b	.L3
.L2:
	ldr	r3, [fp, #-28]
.L3:
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	sub	r3, r3, #1
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bhi	.L4
	ldr	r3, [fp, #-24]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	ldr	r1, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L4
	ldr	r3, [fp, #-12]
	b	.L5
.L4:
	ldr	r3, [fp, #-8]
.L5:
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	beq	.L7
	ldr	r3, [fp, #-24]
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-24]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r1, r3
	bl	swap
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	lsr	r3, r3, #1
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bhi	.L7
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-24]
	bl	heapify
.L7:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	heapify, .-heapify
	.align	2
	.global	buildHeap
	.syntax unified
	.arm
	.fpu softvfp
	.type	buildHeap, %function
buildHeap:
	@ 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]
	str	r1, [fp, #-28]
	mov	r0, #12
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-28]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-28]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	lsr	r3, r3, #1
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-16]
	b	.L9
.L10:
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	heapify
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	str	r3, [fp, #-16]
.L9:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L10
	ldr	r3, [fp, #-12]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	buildHeap, .-buildHeap
	.align	2
	.global	heapSort
	.syntax unified
	.arm
	.fpu softvfp
	.type	heapSort, %function
heapSort:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-24]
	bl	buildHeap
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-16]
	b	.L13
.L14:
	ldr	r3, [fp, #-12]
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r1, r3
	bl	swap
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	sub	r2, r3, #1
	ldr	r3, [fp, #-12]
	str	r2, [r3, #8]
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	heapify
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	str	r3, [fp, #-16]
.L13:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bgt	.L14
	ldr	r0, [fp, #-12]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	heapSort, .-heapSort
	.section	.rodata
	.align	2
.LC1:
	.ascii	"\012 After applying the Heap Sort sorting algorithm"
	.ascii	" the array is: \000"
	.align	2
.LC2:
	.ascii	"%d \000"
	.align	2
.LC0:
	.word	200
	.word	190
	.word	10
	.word	-1
	.word	29
	.word	24
	.word	3
	.word	120
	.word	31
	.word	2
	.word	0
	.word	9
	.word	21
	.word	2
	.word	65
	.word	4
	.word	7
	.word	1
	.word	-9
	.word	2
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 96
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #96
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L20+4
	sub	r3, fp, #88
	mov	r1, r2
	mov	r2, #80
	mov	r0, r3
	bl	memcpy
	sub	r3, fp, #88
	str	r3, [fp, #-92]
	mov	r1, #20
	ldr	r0, [fp, #-92]
	bl	heapSort
	ldr	r0, .L20+8
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-96]
	b	.L16
.L17:
	ldr	r3, [fp, #-96]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-84]
	mov	r1, r3
	ldr	r0, .L20+12
	bl	printf
	ldr	r3, [fp, #-96]
	add	r3, r3, #1
	str	r3, [fp, #-96]
.L16:
	ldr	r3, [fp, #-96]
	cmp	r3, #19
	bls	.L17
	mov	r0, #10
	bl	putchar
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
