	.file	"606867.c"
	.intel_syntax noprefix
	.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -20[rbp], 36
	mov	edi, 4
	call	Malloc
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], 36
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -20[rbp], eax
	je	.L2
	mov	eax, 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	Free
	mov	edi, 1048577
	call	Malloc
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L4
	mov	eax, 1
	jmp	.L3
.L4:
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.local	max_allocated
	.comm	max_allocated,4,4
	.local	base
	.comm	base,16,16
	.local	freep
	.comm	freep,8,8
	.globl	Malloc
	.type	Malloc, @function
Malloc:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	eax, DWORD PTR -36[rbp]
	add	rax, 15
	shr	rax, 4
	add	eax, 1
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -36[rbp], 1048576
	jbe	.L6
	mov	eax, 0
	jmp	.L7
.L6:
	mov	rax, QWORD PTR freep[rip]
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L8
	lea	rax, base[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR freep[rip], rax
	mov	rax, QWORD PTR freep[rip]
	mov	QWORD PTR base[rip], rax
	mov	DWORD PTR base[rip+8], 0
.L8:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
.L13:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	cmp	DWORD PTR -20[rbp], eax
	ja	.L9
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	cmp	DWORD PTR -20[rbp], eax
	jne	.L10
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L11
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	sub	eax, DWORD PTR -20[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	eax, eax
	sal	rax, 4
	add	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR 8[rax], edx
.L11:
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR freep[rip], rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	jmp	.L7
.L9:
	mov	rax, QWORD PTR freep[rip]
	cmp	QWORD PTR -16[rbp], rax
	jne	.L12
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	Morecore
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L12
	mov	eax, 0
	jmp	.L7
.L12:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L13
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Malloc, .-Malloc
	.type	Morecore, @function
Morecore:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	cmp	DWORD PTR -20[rbp], 1023
	ja	.L15
	mov	DWORD PTR -20[rbp], 1024
.L15:
	mov	eax, DWORD PTR -20[rbp]
	sal	eax, 4
	mov	edi, eax
	call	sbrk@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L16
	mov	eax, 0
	jmp	.L17
.L16:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR max_allocated[rip]
	cmp	edx, eax
	cmovnb	eax, edx
	mov	DWORD PTR max_allocated[rip], eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 16
	mov	rdi, rax
	call	Free
	mov	rax, QWORD PTR freep[rip]
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Morecore, .-Morecore
	.globl	Free
	.type	Free, @function
Free:
.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	rax, QWORD PTR -24[rbp]
	sub	rax, 16
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	test	eax, eax
	jne	.L19
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR max_allocated[rip]
	cmp	edx, eax
	jnb	.L28
.L19:
	mov	rax, QWORD PTR freep[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jbe	.L29
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	QWORD PTR -16[rbp], rax
	jmp	.L22
.L29:
	nop
.L22:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	eax, eax
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	rdx, rax
	jne	.L24
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR 8[rax]
	add	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L25
.L24:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rax], rdx
.L25:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	eax, eax
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	cmp	QWORD PTR -16[rbp], rax
	jne	.L26
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	add	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L27
.L26:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR [rax], rdx
.L27:
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR freep[rip], rax
	jmp	.L18
.L28:
	nop
.L18:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	Free, .-Free
	.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	"606867.c"
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #36
	str	r3, [fp, #-16]
	mov	r0, #4
	bl	Malloc
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r2, #36
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	beq	.L2
	mov	r3, #1
	b	.L3
.L2:
	ldr	r0, [fp, #-12]
	bl	Free
	ldr	r0, .L5
	bl	Malloc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L4
	mov	r3, #1
	b	.L3
.L4:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	1048577
	.size	main, .-main
	.local	max_allocated
	.comm	max_allocated,4,4
	.local	base
	.comm	base,8,4
	.local	freep
	.comm	freep,4,4
	.align	2
	.global	Malloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	Malloc, %function
Malloc:
	@ 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]
	add	r3, r3, #7
	lsr	r3, r3, #3
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r3, #1048576
	bls	.L8
	mov	r3, #0
	b	.L9
.L8:
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L10
	ldr	r3, .L16+4
	str	r3, [fp, #-12]
	ldr	r2, .L16
	ldr	r3, [fp, #-12]
	str	r3, [r2]
	ldr	r3, .L16
	ldr	r3, [r3]
	ldr	r2, .L16+4
	str	r3, [r2]
	ldr	r3, .L16+4
	mov	r2, #0
	str	r2, [r3, #4]
.L10:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
.L15:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bhi	.L11
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bne	.L12
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	b	.L13
.L12:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	sub	r2, r2, r3
	ldr	r3, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #4]
.L13:
	ldr	r2, .L16
	ldr	r3, [fp, #-12]
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #8
	b	.L9
.L11:
	ldr	r3, .L16
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L14
	ldr	r0, [fp, #-8]
	bl	Morecore
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L14
	mov	r3, #0
	b	.L9
.L14:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	b	.L15
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	freep
	.word	base
	.size	Malloc, .-Malloc
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	Morecore, %function
Morecore:
	@ 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]
	ldr	r3, [fp, #-16]
	cmp	r3, #1024
	bcs	.L19
	mov	r3, #1024
	str	r3, [fp, #-16]
.L19:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #3
	mov	r0, r3
	bl	sbrk
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L20
	mov	r3, #0
	b	.L21
.L20:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #4]
	ldr	r3, .L22
	ldr	r3, [r3]
	cmp	r2, r3
	movcs	r3, r2
	movcc	r3, r3
	ldr	r2, .L22
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #8
	mov	r0, r3
	bl	Free
	ldr	r3, .L22+4
	ldr	r3, [r3]
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	max_allocated
	.word	freep
	.size	Morecore, .-Morecore
	.align	2
	.global	Free
	.syntax unified
	.arm
	.fpu softvfp
	.type	Free, %function
Free:
	@ 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]
	ldr	r3, [fp, #-16]
	sub	r3, r3, #8
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L25
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #4]
	ldr	r3, .L36
	ldr	r3, [r3]
	cmp	r2, r3
	bcs	.L34
.L25:
	ldr	r3, .L36+4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bls	.L35
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	b	.L28
.L35:
	nop
.L28:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-12]
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L30
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	add	r2, r2, r3
	ldr	r3, [fp, #-12]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	b	.L31
.L30:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	str	r2, [r3]
.L31:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bne	.L32
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	b	.L33
.L32:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	str	r2, [r3]
.L33:
	ldr	r2, .L36+4
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	b	.L24
.L34:
	nop
.L24:
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L37:
	.align	2
.L36:
	.word	max_allocated
	.word	freep
	.size	Free, .-Free
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
