	.file	"739207.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Array size : "
.LC1:
	.string	"%d"
.LC2:
	.string	"Enter array elements : "
.LC3:
	.string	"Array elements : "
.LC4:
	.string	"%d "
	.align 8
.LC5:
	.string	"The elements after sorting with its weight is : "
.LC6:
	.string	"< %d , %d >\n"
	.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, 40
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -44[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -40[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -40[rbp], 1
.L2:
	mov	eax, DWORD PTR -44[rbp]
	cmp	DWORD PTR -40[rbp], eax
	jl	.L3
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -40[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -40[rbp], 1
.L4:
	mov	eax, DWORD PTR -44[rbp]
	cmp	DWORD PTR -40[rbp], eax
	jl	.L5
	mov	DWORD PTR -40[rbp], 0
	jmp	.L6
.L10:
	mov	DWORD PTR -36[rbp], 0
	jmp	.L7
.L9:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	check
	mov	ebx, eax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	check
	cmp	ebx, eax
	jle	.L8
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	add	rax, 1
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	add	rax, 1
	lea	rsi, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rsi
	mov	edx, DWORD PTR [rdx]
	mov	DWORD PTR [rax], edx
	mov	esi, DWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	sub	ecx, esi
	mov	edx, ecx
	mov	DWORD PTR [rax], edx
.L8:
	add	DWORD PTR -36[rbp], 1
.L7:
	mov	eax, DWORD PTR -44[rbp]
	sub	eax, DWORD PTR -40[rbp]
	sub	eax, 1
	cmp	DWORD PTR -36[rbp], eax
	jl	.L9
	add	DWORD PTR -40[rbp], 1
.L6:
	mov	eax, DWORD PTR -44[rbp]
	sub	eax, 1
	cmp	DWORD PTR -40[rbp], eax
	jl	.L10
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	DWORD PTR -40[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	check
	mov	edx, eax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -40[rbp], 1
.L11:
	mov	eax, DWORD PTR -44[rbp]
	cmp	DWORD PTR -40[rbp], eax
	jl	.L12
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	check
	.type	check, @function
check:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -4[rbp], 1
	jmp	.L16
.L18:
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jne	.L17
	add	DWORD PTR -8[rbp], 5
.L17:
	add	DWORD PTR -4[rbp], 2
.L16:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L18
	mov	eax, DWORD PTR -20[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L19
	mov	ecx, DWORD PTR -20[rbp]
	movsx	rax, ecx
	imul	rax, rax, 715827883
	shr	rax, 32
	mov	esi, ecx
	sar	esi, 31
	mov	edx, eax
	sub	edx, esi
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	test	edx, edx
	jne	.L19
	add	DWORD PTR -8[rbp], 4
.L19:
	mov	eax, DWORD PTR -20[rbp]
	and	eax, 1
	test	eax, eax
	jne	.L20
	add	DWORD PTR -8[rbp], 3
.L20:
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	check, .-check
	.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	"739207.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Array size : \000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"Enter array elements : \000"
	.align	2
.LC3:
	.ascii	"Array elements : \000"
	.align	2
.LC4:
	.ascii	"%d \000"
	.align	2
.LC5:
	.ascii	"The elements after sorting with its weight is : \000"
	.align	2
.LC6:
	.ascii	"< %d , %d >\012\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 = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r0, .L15+4
	bl	printf
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, .L15+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r0, .L15+12
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L2
.L3:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L15+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L2:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L3
	ldr	r0, .L15+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L4
.L5:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L15+20
	bl	printf
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L4:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L5
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L6
.L10:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L7
.L9:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	check
	mov	r4, r0
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	check
	mov	r3, r0
	cmp	r4, r3
	ble	.L8
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r1, r2, r3
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r0, [fp, #-20]
	add	r3, r0, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r0, [fp, #-20]
	add	r3, r0, r3
	sub	r2, r1, r2
	str	r2, [r3]
.L8:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L7:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-28]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L9
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L6:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L10
	ldr	r0, .L15+24
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L11
.L12:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r4, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	check
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L15+28
	bl	printf
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L11:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L12
	ldr	r0, [fp, #-20]
	bl	free
	mov	r3, #0
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.align	2
	.global	check
	.syntax unified
	.arm
	.fpu softvfp
	.type	check, %function
check:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L18
.L20:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bne	.L19
	ldr	r3, [fp, #-12]
	add	r3, r3, #5
	str	r3, [fp, #-12]
.L19:
	ldr	r3, [fp, #-8]
	add	r3, r3, #2
	str	r3, [fp, #-8]
.L18:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L20
	ldr	r3, [fp, #-24]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L21
	ldr	r1, [fp, #-24]
	ldr	r3, .L24
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L21
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	str	r3, [fp, #-12]
.L21:
	ldr	r3, [fp, #-24]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L22
	ldr	r3, [fp, #-12]
	add	r3, r3, #3
	str	r3, [fp, #-12]
.L22:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L25:
	.align	2
.L24:
	.word	715827883
	.size	check, .-check
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
