	.file	"15763534.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Incorrect number of command line arguments"
	.align 8
.LC1:
	.string	"Correct usage: ./a.out <input file>"
.LC2:
	.string	"Fail to open the file."
.LC3:
	.string	"The array is sorted:"
.LC4:
	.string	"%d "
.LC5:
	.string	"Magic number: %d\n"
.LC6:
	.string	"Fail to sort the array."
	.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, 4048
	mov	DWORD PTR -4036[rbp], edi
	mov	QWORD PTR -4048[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -4036[rbp], 2
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L9
.L2:
	mov	rax, QWORD PTR -4048[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	lea	rax, -4016[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	populate_array
	mov	DWORD PTR -4024[rbp], eax
	cmp	DWORD PTR -4024[rbp], -1
	jne	.L4
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L4:
	mov	eax, DWORD PTR -4024[rbp]
	lea	edx, -1[rax]
	lea	rax, -4016[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	mergesort
	mov	edx, DWORD PTR -4024[rbp]
	lea	rax, -4016[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	is_sorted
	cmp	eax, 1
	jne	.L5
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -4028[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -4028[rbp]
	cdqe
	mov	eax, DWORD PTR -4016[rbp+rax*4]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -4028[rbp], 1
.L6:
	mov	eax, DWORD PTR -4028[rbp]
	cmp	eax, DWORD PTR -4024[rbp]
	jl	.L7
	mov	edi, 10
	call	putchar@PLT
	mov	edx, DWORD PTR -4024[rbp]
	lea	rax, -4016[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	magic_index
	mov	DWORD PTR -4020[rbp], eax
	mov	eax, DWORD PTR -4020[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L8
.L5:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L8:
	mov	eax, 0
.L9:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	mergesort
	.type	mergesort, @function
mergesort:
.LFB1:
	.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	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	edx, DWORD PTR -28[rbp]
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jge	.L14
	mov	eax, DWORD PTR -32[rbp]
	sub	eax, DWORD PTR -28[rbp]
	cmp	eax, 4
	jg	.L13
	mov	eax, DWORD PTR -32[rbp]
	sub	eax, DWORD PTR -28[rbp]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	insertionsort
.L13:
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	mergesort
	mov	eax, DWORD PTR -4[rbp]
	lea	ecx, 1[rax]
	mov	edx, DWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	mergesort
	mov	ecx, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	esi, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	merge
.L14:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	mergesort, .-mergesort
	.globl	merge
	.type	merge, @function
merge:
.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, 4064
	mov	QWORD PTR -4040[rbp], rdi
	mov	DWORD PTR -4044[rbp], esi
	mov	DWORD PTR -4048[rbp], edx
	mov	DWORD PTR -4052[rbp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -4044[rbp]
	mov	DWORD PTR -4028[rbp], eax
	mov	eax, DWORD PTR -4048[rbp]
	add	eax, 1
	mov	DWORD PTR -4024[rbp], eax
	mov	eax, DWORD PTR -4044[rbp]
	mov	DWORD PTR -4020[rbp], eax
	jmp	.L16
.L19:
	mov	eax, DWORD PTR -4028[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -4024[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jge	.L17
	mov	eax, DWORD PTR -4028[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4028[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -4020[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4020[rbp], edx
	mov	edx, DWORD PTR [rcx]
	cdqe
	mov	DWORD PTR -4016[rbp+rax*4], edx
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -4024[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4024[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -4020[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4020[rbp], edx
	mov	edx, DWORD PTR [rcx]
	cdqe
	mov	DWORD PTR -4016[rbp+rax*4], edx
.L16:
	mov	eax, DWORD PTR -4028[rbp]
	cmp	eax, DWORD PTR -4048[rbp]
	jg	.L20
	mov	eax, DWORD PTR -4024[rbp]
	cmp	eax, DWORD PTR -4052[rbp]
	jle	.L19
	jmp	.L20
.L21:
	mov	eax, DWORD PTR -4028[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4028[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -4020[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4020[rbp], edx
	mov	edx, DWORD PTR [rcx]
	cdqe
	mov	DWORD PTR -4016[rbp+rax*4], edx
.L20:
	mov	eax, DWORD PTR -4028[rbp]
	cmp	eax, DWORD PTR -4048[rbp]
	jle	.L21
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -4024[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4024[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -4020[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4020[rbp], edx
	mov	edx, DWORD PTR [rcx]
	cdqe
	mov	DWORD PTR -4016[rbp+rax*4], edx
.L22:
	mov	eax, DWORD PTR -4024[rbp]
	cmp	eax, DWORD PTR -4052[rbp]
	jle	.L23
	mov	eax, DWORD PTR -4044[rbp]
	mov	DWORD PTR -4028[rbp], eax
	jmp	.L24
.L25:
	mov	eax, DWORD PTR -4028[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -4040[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4028[rbp]
	cdqe
	mov	eax, DWORD PTR -4016[rbp+rax*4]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -4028[rbp], 1
.L24:
	mov	eax, DWORD PTR -4028[rbp]
	cmp	eax, DWORD PTR -4052[rbp]
	jle	.L25
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	merge, .-merge
	.globl	insertionsort
	.type	insertionsort, @function
insertionsort:
.LFB3:
	.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	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -12[rbp], 0
	jmp	.L28
.L32:
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -8[rbp], eax
	jmp	.L29
.L31:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -8[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rdx], eax
	sub	DWORD PTR -8[rbp], 1
.L29:
	cmp	DWORD PTR -8[rbp], 0
	jle	.L30
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	lea	rcx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jl	.L31
.L30:
	add	DWORD PTR -12[rbp], 1
.L28:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L32
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	insertionsort, .-insertionsort
	.globl	magic_index
	.type	magic_index, @function
magic_index:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jge	.L34
	mov	eax, -1
	jmp	.L35
.L34:
	mov	edx, DWORD PTR -32[rbp]
	mov	eax, DWORD PTR -28[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -4[rbp], eax
	jle	.L36
	mov	eax, DWORD PTR -4[rbp]
	lea	ecx, 1[rax]
	mov	edx, DWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	magic_index
	jmp	.L35
.L36:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -4[rbp], eax
	jge	.L37
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, -1[rax]
	mov	ecx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	magic_index
	jmp	.L35
.L37:
	mov	eax, DWORD PTR -4[rbp]
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	magic_index, .-magic_index
	.section	.rodata
.LC7:
	.string	"r"
.LC8:
	.string	"%d"
	.text
	.globl	populate_array
	.type	populate_array, @function
populate_array:
.LFB5:
	.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	DWORD PTR -12[rbp], 0
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L39
	mov	eax, -1
	jmp	.L40
.L39:
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -12[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	jne	.L44
	jmp	.L39
.L44:
	nop
	mov	eax, DWORD PTR -12[rbp]
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	populate_array, .-populate_array
	.globl	is_sorted
	.type	is_sorted, @function
is_sorted:
.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	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L46
.L49:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, 1
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L47
	mov	eax, 0
	jmp	.L48
.L47:
	add	DWORD PTR -4[rbp], 1
.L46:
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	cmp	DWORD PTR -4[rbp], eax
	jl	.L49
	mov	eax, 1
.L48:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	is_sorted, .-is_sorted
	.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	"15763534.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Incorrect number of command line arguments\000"
	.align	2
.LC1:
	.ascii	"Correct usage: ./a.out <input file>\000"
	.align	2
.LC2:
	.ascii	"Fail to open the file.\000"
	.align	2
.LC3:
	.ascii	"The array is sorted:\000"
	.align	2
.LC4:
	.ascii	"%d \000"
	.align	2
.LC5:
	.ascii	"Magic number: %d\012\000"
	.align	2
.LC6:
	.ascii	"Fail to sort the array.\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 4024
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #4016
	sub	sp, sp, #8
	str	r0, [fp, #-4024]
	str	r1, [fp, #-4028]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-4024]
	cmp	r3, #2
	beq	.L2
	ldr	r0, .L11+4
	bl	puts
	ldr	r0, .L11+8
	bl	puts
	mov	r3, #0
	b	.L9
.L2:
	ldr	r3, [fp, #-4028]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #4000
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	populate_array
	str	r0, [fp, #-4016]
	ldr	r3, [fp, #-4016]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L11+12
	bl	puts
.L4:
	ldr	r3, [fp, #-4016]
	sub	r2, r3, #1
	sub	r3, fp, #4000
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	mergesort
	sub	r3, fp, #4000
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, [fp, #-4016]
	mov	r0, r3
	bl	is_sorted
	mov	r3, r0
	cmp	r3, #1
	bne	.L5
	ldr	r0, .L11+16
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-4020]
	b	.L6
.L7:
	ldr	r3, [fp, #-4020]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-4004]
	mov	r1, r3
	ldr	r0, .L11+20
	bl	printf
	ldr	r3, [fp, #-4020]
	add	r3, r3, #1
	str	r3, [fp, #-4020]
.L6:
	ldr	r2, [fp, #-4020]
	ldr	r3, [fp, #-4016]
	cmp	r2, r3
	blt	.L7
	mov	r0, #10
	bl	putchar
	sub	r3, fp, #4000
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [fp, #-4016]
	mov	r1, #0
	mov	r0, r3
	bl	magic_index
	str	r0, [fp, #-4012]
	ldr	r1, [fp, #-4012]
	ldr	r0, .L11+24
	bl	printf
	b	.L8
.L5:
	ldr	r0, .L11+28
	bl	puts
.L8:
	mov	r3, #0
.L9:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.align	2
	.global	mergesort
	.syntax unified
	.arm
	.fpu softvfp
	.type	mergesort, %function
mergesort:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bge	.L16
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	cmp	r3, #4
	bgt	.L15
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	insertionsort
.L15:
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	mergesort
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	mergesort
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	merge
.L16:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	mergesort, .-mergesort
	.section	.rodata
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	merge
	.syntax unified
	.arm
	.fpu softvfp
	.type	merge, %function
merge:
	@ args = 0, pretend = 0, frame = 4032
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #4032
	str	r0, [fp, #-4024]
	str	r1, [fp, #-4028]
	str	r2, [fp, #-4032]
	str	r3, [fp, #-4036]
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-4028]
	str	r3, [fp, #-4020]
	ldr	r3, [fp, #-4032]
	add	r3, r3, #1
	str	r3, [fp, #-4016]
	ldr	r3, [fp, #-4028]
	str	r3, [fp, #-4012]
	b	.L18
.L21:
	ldr	r3, [fp, #-4020]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-4024]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-4016]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-4024]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L19
	ldr	r3, [fp, #-4020]
	add	r2, r3, #1
	str	r2, [fp, #-4020]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-4024]
	add	r2, r2, r3
	ldr	r3, [fp, #-4012]
	add	r1, r3, #1
	str	r1, [fp, #-4012]
	ldr	r2, [r2]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-4004]
	b	.L18
.L19:
	ldr	r3, [fp, #-4016]
	add	r2, r3, #1
	str	r2, [fp, #-4016]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-4024]
	add	r2, r2, r3
	ldr	r3, [fp, #-4012]
	add	r1, r3, #1
	str	r1, [fp, #-4012]
	ldr	r2, [r2]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-4004]
.L18:
	ldr	r2, [fp, #-4020]
	ldr	r3, [fp, #-4032]
	cmp	r2, r3
	bgt	.L22
	ldr	r2, [fp, #-4016]
	ldr	r3, [fp, #-4036]
	cmp	r2, r3
	ble	.L21
	b	.L22
.L23:
	ldr	r3, [fp, #-4020]
	add	r2, r3, #1
	str	r2, [fp, #-4020]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-4024]
	add	r2, r2, r3
	ldr	r3, [fp, #-4012]
	add	r1, r3, #1
	str	r1, [fp, #-4012]
	ldr	r2, [r2]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-4004]
.L22:
	ldr	r2, [fp, #-4020]
	ldr	r3, [fp, #-4032]
	cmp	r2, r3
	ble	.L23
	b	.L24
.L25:
	ldr	r3, [fp, #-4016]
	add	r2, r3, #1
	str	r2, [fp, #-4016]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-4024]
	add	r2, r2, r3
	ldr	r3, [fp, #-4012]
	add	r1, r3, #1
	str	r1, [fp, #-4012]
	ldr	r2, [r2]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-4004]
.L24:
	ldr	r2, [fp, #-4016]
	ldr	r3, [fp, #-4036]
	cmp	r2, r3
	ble	.L25
	ldr	r3, [fp, #-4028]
	str	r3, [fp, #-4020]
	b	.L26
.L27:
	ldr	r3, [fp, #-4020]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-4024]
	add	r2, r2, r3
	ldr	r3, [fp, #-4020]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-4004]
	str	r3, [r2]
	ldr	r3, [fp, #-4020]
	add	r3, r3, #1
	str	r3, [fp, #-4020]
.L26:
	ldr	r2, [fp, #-4020]
	ldr	r3, [fp, #-4036]
	cmp	r2, r3
	ble	.L27
	nop
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC8
	.size	merge, .-merge
	.align	2
	.global	insertionsort
	.syntax unified
	.arm
	.fpu softvfp
	.type	insertionsort, %function
insertionsort:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L32
.L36:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	b	.L33
.L35:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r2, r2, r3
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L33:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	ble	.L34
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L35
.L34:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L32:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L36
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	insertionsort, .-insertionsort
	.align	2
	.global	magic_index
	.syntax unified
	.arm
	.fpu softvfp
	.type	magic_index, %function
magic_index:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bge	.L38
	mvn	r3, #0
	b	.L39
.L38:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	ble	.L40
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	magic_index
	mov	r3, r0
	b	.L39
.L40:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bge	.L41
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	magic_index
	mov	r3, r0
	b	.L39
.L41:
	ldr	r3, [fp, #-8]
.L39:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	magic_index, .-magic_index
	.section	.rodata
	.align	2
.LC9:
	.ascii	"r\000"
	.align	2
.LC10:
	.ascii	"%d\000"
	.text
	.align	2
	.global	populate_array
	.syntax unified
	.arm
	.fpu softvfp
	.type	populate_array, %function
populate_array:
	@ 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]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r1, .L49
	ldr	r0, [fp, #-20]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L43
	mvn	r3, #0
	b	.L44
.L43:
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L49+4
	ldr	r0, [fp, #-8]
	bl	__isoc99_fscanf
	ldr	r0, [fp, #-8]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	bne	.L48
	b	.L43
.L48:
	nop
	ldr	r3, [fp, #-12]
.L44:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	.LC9
	.word	.LC10
	.size	populate_array, .-populate_array
	.align	2
	.global	is_sorted
	.syntax unified
	.arm
	.fpu softvfp
	.type	is_sorted, %function
is_sorted:
	@ 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]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L52
.L55:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L53
	mov	r3, #0
	b	.L54
.L53:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L52:
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L55
	mov	r3, #1
.L54:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	is_sorted, .-is_sorted
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
