	.file	"700622.c"
	.intel_syntax noprefix
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"Preparing arrays..."
.LC1:
	.string	"DONE"
.LC2:
	.string	"Sorting arrays..."
.LC3:
	.string	"Done sorting"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	esi, 8
	mov	edi, 1000
	call	calloc@PLT
	mov	QWORD PTR -24[rbp], rax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	DWORD PTR i[rip], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR i[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	lea	rbx, [rdx+rax]
	mov	esi, 4
	mov	edi, 1000000
	call	calloc@PLT
	mov	QWORD PTR [rbx], rax
	mov	DWORD PTR n[rip], 0
	jmp	.L3
.L4:
	mov	eax, DWORD PTR i[rip]
	imul	eax, eax, -1000000
	lea	edx, 1000000000[rax]
	mov	ecx, DWORD PTR n[rip]
	mov	eax, DWORD PTR i[rip]
	cdqe
	lea	rsi, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rsi
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR n[rip]
	cdqe
	sal	rax, 2
	add	rax, rsi
	sub	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR n[rip]
	add	eax, 1
	mov	DWORD PTR n[rip], eax
.L3:
	mov	eax, DWORD PTR n[rip]
	cmp	eax, 999999
	jle	.L4
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L2:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 999
	jle	.L5
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	debug_all_numbers
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	DWORD PTR i[rip], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR i[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rcx, cmpfunc[rip]
	mov	edx, 4
	mov	esi, 1000000
	mov	rdi, rax
	call	qsort@PLT
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L6:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 999
	jle	.L7
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	debug_all_numbers
	mov	eax, 0
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"First 5 arrays:"
.LC5:
	.string	" ..."
	.text
	.globl	debug_all_numbers
	.type	debug_all_numbers, @function
debug_all_numbers:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	DWORD PTR i[rip], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR i[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	debug_numbers
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L10:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 4
	jle	.L11
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	DWORD PTR i[rip], 995
	jmp	.L12
.L13:
	mov	eax, DWORD PTR i[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	debug_numbers
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L12:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 999
	jle	.L13
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	debug_all_numbers, .-debug_all_numbers
	.section	.rodata
.LC6:
	.string	"  [ "
.LC7:
	.string	"%07d "
.LC8:
	.string	" ... "
.LC9:
	.string	"]"
	.text
	.globl	debug_numbers
	.type	debug_numbers, @function
debug_numbers:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR n[rip], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR n[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR n[rip]
	add	eax, 1
	mov	DWORD PTR n[rip], eax
.L15:
	mov	eax, DWORD PTR n[rip]
	cmp	eax, 2
	jle	.L16
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR n[rip], 999997
	jmp	.L17
.L18:
	mov	eax, DWORD PTR n[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR n[rip]
	add	eax, 1
	mov	DWORD PTR n[rip], eax
.L17:
	mov	eax, DWORD PTR n[rip]
	cmp	eax, 999999
	jle	.L18
	lea	rdi, .LC9[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	debug_numbers, .-debug_numbers
	.globl	cmpfunc
	.type	cmpfunc, @function
cmpfunc:
.LFB9:
	.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 -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	ecx, DWORD PTR [rax]
	mov	eax, edx
	sub	eax, ecx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmpfunc, .-cmpfunc
	.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	"700622.c"
	.text
	.comm	i,4,4
	.comm	n,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Preparing arrays...\000"
	.align	2
.LC1:
	.ascii	"DONE\000"
	.align	2
.LC2:
	.ascii	"Sorting arrays...\000"
	.align	2
.LC3:
	.ascii	"Done sorting\000"
	.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
	mov	r1, #4
	mov	r0, #1000
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r0, .L9
	bl	puts
	ldr	r3, .L9+4
	mov	r2, #0
	str	r2, [r3]
	b	.L2
.L5:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r4, r2, r3
	mov	r1, #4
	ldr	r0, .L9+8
	bl	calloc
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, .L9+12
	mov	r2, #0
	str	r2, [r3]
	b	.L3
.L4:
	ldr	r3, .L9+4
	ldr	r1, [r3]
	mov	r2, r1
	lsl	r2, r2, #5
	sub	r2, r2, r1
	lsl	r3, r2, #6
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #6
	rsb	r2, r3, #0
	ldr	r3, .L9+16
	add	r3, r2, r3
	ldr	r2, .L9+12
	ldr	r1, [r2]
	ldr	r2, .L9+4
	ldr	r2, [r2]
	lsl	r2, r2, #2
	ldr	r0, [fp, #-16]
	add	r2, r0, r2
	ldr	r0, [r2]
	ldr	r2, .L9+12
	ldr	r2, [r2]
	lsl	r2, r2, #2
	add	r2, r0, r2
	sub	r3, r3, r1
	str	r3, [r2]
	ldr	r3, .L9+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+12
	str	r3, [r2]
.L3:
	ldr	r3, .L9+12
	ldr	r3, [r3]
	ldr	r2, .L9+8
	cmp	r3, r2
	blt	.L4
	ldr	r3, .L9+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+4
	str	r3, [r2]
.L2:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #1000
	blt	.L5
	ldr	r0, .L9+20
	bl	puts
	ldr	r0, [fp, #-16]
	bl	debug_all_numbers
	ldr	r0, .L9+24
	bl	puts
	ldr	r3, .L9+4
	mov	r2, #0
	str	r2, [r3]
	b	.L6
.L7:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r3, .L9+28
	mov	r2, #4
	ldr	r1, .L9+8
	bl	qsort
	ldr	r3, .L9+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+4
	str	r3, [r2]
.L6:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #1000
	blt	.L7
	ldr	r0, .L9+32
	bl	puts
	ldr	r0, [fp, #-16]
	bl	debug_all_numbers
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	i
	.word	1000000
	.word	n
	.word	1000000000
	.word	.LC1
	.word	.LC2
	.word	cmpfunc
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"First 5 arrays:\000"
	.align	2
.LC5:
	.ascii	" ...\000"
	.text
	.align	2
	.global	debug_all_numbers
	.syntax unified
	.arm
	.fpu softvfp
	.type	debug_all_numbers, %function
debug_all_numbers:
	@ 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, .L16
	bl	puts
	ldr	r3, .L16+4
	mov	r2, #0
	str	r2, [r3]
	b	.L12
.L13:
	ldr	r3, .L16+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	debug_numbers
	ldr	r3, .L16+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L16+4
	str	r3, [r2]
.L12:
	ldr	r3, .L16+4
	ldr	r3, [r3]
	cmp	r3, #4
	ble	.L13
	ldr	r0, .L16+8
	bl	puts
	ldr	r3, .L16+4
	ldr	r2, .L16+12
	str	r2, [r3]
	b	.L14
.L15:
	ldr	r3, .L16+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	debug_numbers
	ldr	r3, .L16+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L16+4
	str	r3, [r2]
.L14:
	ldr	r3, .L16+4
	ldr	r3, [r3]
	cmp	r3, #1000
	blt	.L15
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC4
	.word	i
	.word	.LC5
	.word	995
	.size	debug_all_numbers, .-debug_all_numbers
	.section	.rodata
	.align	2
.LC6:
	.ascii	"  [ \000"
	.align	2
.LC7:
	.ascii	"%07d \000"
	.align	2
.LC8:
	.ascii	" ... \000"
	.align	2
.LC9:
	.ascii	"]\000"
	.text
	.align	2
	.global	debug_numbers
	.syntax unified
	.arm
	.fpu softvfp
	.type	debug_numbers, %function
debug_numbers:
	@ 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, .L23
	bl	printf
	ldr	r3, .L23+4
	mov	r2, #0
	str	r2, [r3]
	b	.L19
.L20:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+8
	bl	printf
	ldr	r3, .L23+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L23+4
	str	r3, [r2]
.L19:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L20
	ldr	r0, .L23+12
	bl	printf
	ldr	r3, .L23+4
	ldr	r2, .L23+16
	str	r2, [r3]
	b	.L21
.L22:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+8
	bl	printf
	ldr	r3, .L23+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L23+4
	str	r3, [r2]
.L21:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	ldr	r2, .L23+20
	cmp	r3, r2
	blt	.L22
	ldr	r0, .L23+24
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC6
	.word	n
	.word	.LC7
	.word	.LC8
	.word	999997
	.word	1000000
	.word	.LC9
	.size	debug_numbers, .-debug_numbers
	.align	2
	.global	cmpfunc
	.syntax unified
	.arm
	.fpu softvfp
	.type	cmpfunc, %function
cmpfunc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	sub	r3, r2, r3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	cmpfunc, .-cmpfunc
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
