	.file	"814414.c"
	.intel_syntax noprefix
	.text
	.globl	Q
	.section	.data.rel.local,"aw"
	.align 32
	.type	Q, @object
	.size	Q, 384
Q:
	.quad	0
	.quad	Q+24
	.long	37
	.zero	4
	.quad	Q
	.quad	Q+48
	.long	42
	.zero	4
	.quad	Q+24
	.quad	Q+72
	.long	55
	.zero	4
	.quad	Q+48
	.quad	Q+96
	.long	11
	.zero	4
	.quad	Q+72
	.quad	Q+120
	.long	12
	.zero	4
	.quad	Q+96
	.quad	Q+144
	.long	71
	.zero	4
	.quad	Q+120
	.quad	Q+168
	.long	34
	.zero	4
	.quad	Q+144
	.quad	Q+192
	.long	35
	.zero	4
	.quad	Q+168
	.quad	Q+216
	.long	16
	.zero	4
	.quad	Q+192
	.quad	Q+240
	.long	61
	.zero	4
	.quad	Q+216
	.quad	Q+264
	.long	36
	.zero	4
	.quad	Q+240
	.quad	Q+288
	.long	49
	.zero	4
	.quad	Q+264
	.quad	Q+312
	.long	48
	.zero	4
	.quad	Q+288
	.quad	Q+336
	.long	10
	.zero	4
	.quad	Q+312
	.quad	Q+360
	.long	32
	.zero	4
	.quad	Q+336
	.quad	0
	.long	80
	.zero	4
	.globl	pHead
	.align 8
	.type	pHead, @object
	.size	pHead, 8
pHead:
	.quad	Q
	.section	.rodata
.LC0:
	.string	" [%2d] -> "
.LC1:
	.string	"%2d"
.LC2:
	.string	" -> [%2d]\n"
	.text
	.globl	PrintNodes
	.type	PrintNodes, @function
PrintNodes:
.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, 16
	mov	rax, QWORD PTR pHead[rip]
	mov	QWORD PTR -8[rbp], rax
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L2
	mov	edi, 32
	call	putchar@PLT
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 16[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]
	test	rax, rax
	jne	.L4
	mov	edi, 10
	call	putchar@PLT
	jmp	.L5
.L4:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L6
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	PrintNodes, .-PrintNodes
	.section	.rodata
.LC3:
	.string	"Before:"
.LC4:
	.string	"After:"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	call	PrintNodes
	mov	rax, QWORD PTR pHead[rip]
	mov	rdi, rax
	call	HeapSort
	mov	QWORD PTR pHead[rip], rax
	lea	rdi, .LC4[rip]
	call	puts@PLT
	call	PrintNodes
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	HeapInsert
	.type	HeapInsert, @function
HeapInsert:
.LFB2:
	.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
	mov	QWORD PTR -16[rbp], rsi
	cmp	QWORD PTR -8[rbp], 0
	jne	.L10
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	jmp	.L11
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 16[rax]
	cmp	edx, eax
	jle	.L12
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	HeapInsert
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -16[rbp]
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	HeapInsert
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -8[rbp]
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	HeapInsert, .-HeapInsert
	.globl	HeapRemove
	.type	HeapRemove, @function
HeapRemove:
.LFB3:
	.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	QWORD PTR -24[rbp], rdi
	cmp	QWORD PTR -24[rbp], 0
	jne	.L14
	mov	eax, 0
	jmp	.L15
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L16
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	jmp	.L15
.L16:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L17
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	jmp	.L15
.L17:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 16[rax]
	cmp	edx, eax
	jle	.L18
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rbx, QWORD PTR [rdx]
	mov	rdi, rax
	call	HeapRemove
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 8[rdx]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	jmp	.L15
.L18:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rbx, QWORD PTR 8[rdx]
	mov	rdi, rax
	call	HeapRemove
	mov	QWORD PTR 8[rbx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR [rdx]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
.L15:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	HeapRemove, .-HeapRemove
	.globl	HeapSort
	.type	HeapSort, @function
HeapSort:
.LFB4:
	.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	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -16[rbp], 0
	jmp	.L20
.L21:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	HeapInsert
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR -32[rbp], rax
.L20:
	cmp	QWORD PTR -32[rbp], 0
	jne	.L21
	mov	QWORD PTR -24[rbp], 0
	jmp	.L22
.L25:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	HeapRemove
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	cmp	QWORD PTR -24[rbp], 0
	jne	.L23
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR -40[rbp], rax
	jmp	.L24
.L23:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	mov	QWORD PTR 8[rax], rdx
.L24:
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR -24[rbp], rax
.L22:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L25
	cmp	QWORD PTR -32[rbp], 0
	je	.L26
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR 8[rax], 0
.L26:
	mov	rax, QWORD PTR -40[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	HeapSort, .-HeapSort
	.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	"814414.c"
	.text
	.global	Q
	.data
	.align	2
	.type	Q, %object
	.size	Q, 192
Q:
	.word	0
	.word	Q+12
	.word	37
	.word	Q
	.word	Q+24
	.word	42
	.word	Q+12
	.word	Q+36
	.word	55
	.word	Q+24
	.word	Q+48
	.word	11
	.word	Q+36
	.word	Q+60
	.word	12
	.word	Q+48
	.word	Q+72
	.word	71
	.word	Q+60
	.word	Q+84
	.word	34
	.word	Q+72
	.word	Q+96
	.word	35
	.word	Q+84
	.word	Q+108
	.word	16
	.word	Q+96
	.word	Q+120
	.word	61
	.word	Q+108
	.word	Q+132
	.word	36
	.word	Q+120
	.word	Q+144
	.word	49
	.word	Q+132
	.word	Q+156
	.word	48
	.word	Q+144
	.word	Q+168
	.word	10
	.word	Q+156
	.word	Q+180
	.word	32
	.word	Q+168
	.word	0
	.word	80
	.global	pHead
	.align	2
	.type	pHead, %object
	.size	pHead, 4
pHead:
	.word	Q
	.section	.rodata
	.align	2
.LC0:
	.ascii	" [%2d] -> \000"
	.align	2
.LC1:
	.ascii	"%2d\000"
	.align	2
.LC2:
	.ascii	" -> [%2d]\012\000"
	.text
	.align	2
	.global	PrintNodes
	.syntax unified
	.arm
	.fpu softvfp
	.type	PrintNodes, %function
PrintNodes:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
.L6:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	mov	r0, #32
	bl	putchar
	b	.L3
.L2:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L7+4
	bl	printf
.L3:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L7+8
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L4
	mov	r0, #10
	bl	putchar
	b	.L5
.L4:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L7+12
	bl	printf
.L5:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L6
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	pHead
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	PrintNodes, .-PrintNodes
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Before:\000"
	.align	2
.LC4:
	.ascii	"After:\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L11
	bl	puts
	bl	PrintNodes
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	HeapSort
	mov	r3, r0
	ldr	r2, .L11+4
	str	r3, [r2]
	ldr	r0, .L11+8
	bl	puts
	bl	PrintNodes
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC3
	.word	pHead
	.word	.LC4
	.size	main, .-main
	.align	2
	.global	HeapInsert
	.syntax unified
	.arm
	.fpu softvfp
	.type	HeapInsert, %function
HeapInsert:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	b	.L15
.L14:
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	cmp	r2, r3
	ble	.L16
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r1, [fp, #-8]
	mov	r0, r3
	bl	HeapInsert
	mov	r2, r0
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	b	.L15
.L16:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	HeapInsert
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	HeapInsert, .-HeapInsert
	.align	2
	.global	HeapRemove
	.syntax unified
	.arm
	.fpu softvfp
	.type	HeapRemove, %function
HeapRemove:
	@ 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
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L18
	mov	r3, #0
	b	.L19
.L18:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L20
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	b	.L19
.L20:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L21
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	b	.L19
.L21:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #8]
	cmp	r2, r3
	ble	.L22
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r4, [r3]
	mov	r0, r2
	bl	HeapRemove
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	ldr	r2, [r2, #4]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	b	.L19
.L22:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r4, [r3, #4]
	mov	r0, r2
	bl	HeapRemove
	mov	r3, r0
	str	r3, [r4, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-16]
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
.L19:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	HeapRemove, .-HeapRemove
	.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]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L24
.L25:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-12]
	bl	HeapInsert
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-20]
.L24:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L25
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L26
.L29:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-20]
	ldr	r0, [fp, #-12]
	bl	HeapRemove
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L27
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-24]
	b	.L28
.L27:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
.L28:
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-16]
.L26:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L29
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L30
	ldr	r3, [fp, #-20]
	mov	r2, #0
	str	r2, [r3, #4]
.L30:
	ldr	r3, [fp, #-24]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	HeapSort, .-HeapSort
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
