	.file	"506444.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Memory failed to allocate!"
	.align 8
.LC1:
	.string	"Memory failed to contain correct data after many allocations (beginning of segment)!"
	.align 8
.LC2:
	.string	"Memory failed to contain correct data after many allocations (end of segment)!"
	.align 8
.LC3:
	.string	"Memory failed to contain correct data after many allocations (mid segment or reused segment)!"
	.align 8
.LC4:
	.string	"Memory was allocated and freed!"
	.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
	sub	rsp, 64
	mov	edi, 1
	call	malloc@PLT
	mov	QWORD PTR -48[rbp], 0
	mov	edi, 3200000
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	edi, 1600000
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -60[rbp], 0
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -64[rbp], 0
	jmp	.L2
.L11:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374698305
	shr	rdx, 32
	sar	edx, 15
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 102377
	sub	eax, ecx
	mov	edx, eax
	lea	eax, 24[rdx]
	mov	DWORD PTR -52[rbp], eax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L3
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	DWORD PTR -56[rbp], 0
	jmp	.L4
.L3:
	mov	eax, DWORD PTR -52[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	QWORD PTR -48[rbp], 0
.L4:
	cmp	QWORD PTR -40[rbp], 0
	jne	.L5
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L6
.L5:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, 94
	jg	.L7
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L8
.L7:
	cmp	DWORD PTR -56[rbp], 0
	jne	.L9
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], rdx
	mov	DWORD PTR -56[rbp], 1
.L9:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, 49
	jg	.L10
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -48[rbp], rax
	jmp	.L8
.L10:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	mov	QWORD PTR [rax], rdx
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -52[rbp]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -60[rbp], 1
.L8:
	add	DWORD PTR -64[rbp], 1
.L2:
	cmp	DWORD PTR -64[rbp], 399999
	jle	.L11
	mov	eax, DWORD PTR -60[rbp]
	sub	eax, 1
	mov	DWORD PTR -64[rbp], eax
	jmp	.L12
.L18:
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR -64[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	cmp	rax, rdx
	je	.L13
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 100
	jmp	.L6
.L13:
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cdqe
	sub	rax, 8
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR -64[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	cmp	rax, rdx
	je	.L14
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 101
	jmp	.L6
.L14:
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 8
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cdqe
	sub	rax, 9
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	jmp	.L15
.L17:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L16
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 102
	jmp	.L6
.L16:
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], 1
	add	QWORD PTR -32[rbp], 1
.L15:
	mov	rax, QWORD PTR -32[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	ja	.L17
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	sub	DWORD PTR -64[rbp], 1
.L12:
	cmp	DWORD PTR -64[rbp], 0
	jns	.L18
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 0
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"506444.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Memory failed to allocate!\000"
	.align	2
.LC1:
	.ascii	"Memory failed to contain correct data after many al"
	.ascii	"locations (beginning of segment)!\000"
	.align	2
.LC2:
	.ascii	"Memory failed to contain correct data after many al"
	.ascii	"locations (end of segment)!\000"
	.align	2
.LC3:
	.ascii	"Memory failed to contain correct data after many al"
	.ascii	"locations (mid segment or reused segment)!\000"
	.align	2
.LC4:
	.ascii	"Memory was allocated and freed!\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	mov	r0, #1
	bl	malloc
	mov	r3, #0
	str	r3, [fp, #-40]
	ldr	r0, .L19
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r0, .L19
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L2
.L11:
	bl	rand
	mov	r2, r0
	ldr	r3, .L19+4
	smull	r1, r3, r2, r3
	asr	r1, r3, #15
	asr	r3, r2, #31
	sub	r3, r1, r3
	ldr	r1, .L19+8
	mul	r3, r1, r3
	sub	r3, r2, r3
	add	r3, r3, #24
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L4
.L3:
	ldr	r3, [fp, #-8]
	mov	r1, r3
	ldr	r0, [fp, #-40]
	bl	realloc
	str	r0, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-40]
.L4:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L19+12
	bl	puts
	mov	r3, #1
	b	.L6
.L5:
	bl	rand
	mov	r1, r0
	ldr	r3, .L19+16
	smull	r2, r3, r1, r3
	asr	r2, r3, #5
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r2, r1, r3
	cmp	r2, #94
	bgt	.L7
	ldr	r0, [fp, #-28]
	bl	free
	b	.L8
.L7:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L9
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r2, r2, r3
	ldr	r3, [fp, #-28]
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-32]
.L9:
	bl	rand
	mov	r1, r0
	ldr	r3, .L19+16
	smull	r2, r3, r1, r3
	asr	r2, r3, #5
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r2, r1, r3
	cmp	r2, #49
	bgt	.L10
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-40]
	b	.L8
.L10:
	ldr	r3, [fp, #-36]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-8]
	sub	r3, r3, #4
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r1, [fp, #-20]
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L8:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L2:
	ldr	r3, [fp, #-44]
	ldr	r2, .L19+20
	cmp	r3, r2
	blt	.L11
	ldr	r3, [fp, #-36]
	sub	r3, r3, #1
	str	r3, [fp, #-44]
	b	.L12
.L18:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	cmp	r2, r3
	beq	.L13
	ldr	r0, .L19+24
	bl	puts
	mov	r3, #100
	b	.L6
.L13:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	cmp	r2, r3
	beq	.L14
	ldr	r0, .L19+28
	bl	puts
	mov	r3, #101
	b	.L6
.L14:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #4
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r3, r3, #5
	add	r3, r2, r3
	str	r3, [fp, #-12]
	b	.L15
.L17:
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L16
	ldr	r0, .L19+32
	bl	puts
	mov	r3, #102
	b	.L6
.L16:
	ldr	r3, [fp, #-24]
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L15:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bhi	.L17
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-44]
	sub	r3, r3, #1
	str	r3, [fp, #-44]
.L12:
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L18
	ldr	r0, .L19+36
	bl	puts
	mov	r3, #0
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	1600000
	.word	1374698305
	.word	102377
	.word	.LC0
	.word	1374389535
	.word	400000
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
