	.file	"extr_memr.c_memr_malloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	memr_malloc
	.type	memr_malloc, @function
memr_malloc:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L11
	mov	rax, rdi
	mov	rcx, QWORD PTR MEM_ALIGNMENT[rip]
	cqo
	idiv	rcx
	test	rdx, rdx
	jne	.L27
	mov	rsi, QWORD PTR UIP_MEM_SIZE[rip]
	cmp	rsi, rdi
	jl	.L11
.L29:
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	r8, QWORD PTR ram_block[rip]
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, QWORD PTR ram_free[rip]
	mov	rax, rbx
	sub	rax, r8
	cmp	rsi, rax
	jle	.L12
	mov	r11, QWORD PTR SIZEOF_STRUCT_MEM[rip]
	lea	rbp, [rdi+r11]
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rdx, [r8+rax]
	mov	rcx, rax
	mov	r9d, DWORD PTR 8[rdx]
	mov	rax, QWORD PTR [rdx]
	test	r9d, r9d
	jne	.L4
	lea	r9, [r11+rcx]
	mov	r10, rax
	sub	r10, r9
	cmp	r10, rbp
	jge	.L28
.L4:
	cmp	rsi, rax
	jg	.L9
.L12:
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore 3
	.cfi_restore 6
	mov	rsi, QWORD PTR SIZEOF_STRUCT_MEM[rip]
	lea	rax, [rsi+rdi]
	cqo
	idiv	rsi
	mov	rsi, QWORD PTR UIP_MEM_SIZE[rip]
	sub	rcx, rdx
	add	rdi, rcx
	cmp	rsi, rdi
	jge	.L29
.L11:
	xor	eax, eax
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	add	r9, rdi
	lea	rdi, [r8+r9]
	mov	QWORD PTR 16[rdi], rcx
	mov	QWORD PTR [rdi], rax
	mov	QWORD PTR [rdx], r9
	cmp	rsi, r9
	je	.L5
	mov	rax, QWORD PTR [rdi]
	mov	QWORD PTR 16[r8+rax], r9
.L5:
	mov	DWORD PTR 8[rdi], 0
	mov	rcx, QWORD PTR ram_end[rip]
	xor	eax, eax
	mov	DWORD PTR 8[rdx], 1
	cmp	rbx, rdx
	je	.L7
.L6:
	lea	rax, [rdx+r11]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	rax, QWORD PTR [rbx]
	add	rax, r8
	mov	rbx, rax
	mov	eax, 1
	mov	esi, DWORD PTR 8[rbx]
	test	esi, esi
	je	.L25
.L7:
	cmp	rbx, rcx
	jne	.L8
	test	al, al
	je	.L6
.L25:
	mov	QWORD PTR ram_free[rip], rbx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	memr_malloc, .-memr_malloc
	.comm	ram_free,8,8
	.comm	ram_end,8,8
	.comm	ram_block,8,8
	.comm	UIP_MEM_SIZE,8,8
	.comm	SIZEOF_STRUCT_MEM,8,8
	.comm	MEM_ALIGNMENT,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_memr.c_memr_malloc.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.global	memr_malloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	memr_malloc, %function
memr_malloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r7, r0, #0
	beq	.L12
	ldr	r3, .L27
	ldr	r4, [r3]
	mov	r1, r4
	bl	__aeabi_idivmod
	cmp	r1, #0
	bne	.L24
.L3:
	ldr	r3, .L27+4
	ldr	r5, [r3]
	cmp	r5, r7
	blt	.L12
	ldr	r3, .L27+8
	ldr	r10, .L27+12
	ldr	r2, [r3]
	ldr	r8, [r10]
	sub	r3, r8, r2
	cmp	r5, r3
	ble	.L12
	ldr	r1, .L27+16
	ldr	r6, [r1]
	add	r9, r7, r6
.L9:
	add	r1, r2, r3
	ldr	lr, [r1, #4]
	mov	ip, r3
	cmp	lr, #0
	add	r4, r6, r3
	ldr	r3, [r2, r3]
	bne	.L4
	sub	r0, r3, r4
	cmp	r0, r9
	bge	.L25
.L4:
	cmp	r5, r3
	bgt	.L9
.L12:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L24:
	ldr	r3, .L27+16
	ldr	r1, [r3]
	add	r0, r1, r7
	bl	__aeabi_idivmod
	sub	r4, r4, r1
	add	r7, r7, r4
	b	.L3
.L25:
	add	r4, r4, r7
	add	r0, r2, r4
	str	ip, [r0, #8]
	cmp	r5, r4
	str	r3, [r2, r4]
	str	r4, [r1]
	ldrne	r3, [r2, r4]
	mov	ip, #1
	addne	r3, r2, r3
	strne	r4, [r3, #8]
	mov	r3, #0
	cmp	r8, r1
	str	r3, [r0, #4]
	str	ip, [r1, #4]
	beq	.L26
.L6:
	add	r0, r1, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L26:
	ldr	r0, .L27+20
	ldr	ip, [r0]
	b	.L7
.L8:
	ldr	r8, [r8]
	mov	r3, #1
	add	r8, r2, r8
	ldr	r0, [r8, #4]
	cmp	r0, #0
	beq	.L22
.L7:
	cmp	r8, ip
	bne	.L8
	cmp	r3, #0
	beq	.L6
.L22:
	str	r8, [r10]
	b	.L6
.L28:
	.align	2
.L27:
	.word	MEM_ALIGNMENT
	.word	UIP_MEM_SIZE
	.word	ram_block
	.word	ram_free
	.word	SIZEOF_STRUCT_MEM
	.word	ram_end
	.size	memr_malloc, .-memr_malloc
	.comm	ram_free,4,4
	.comm	ram_end,4,4
	.comm	ram_block,4,4
	.comm	UIP_MEM_SIZE,4,4
	.comm	SIZEOF_STRUCT_MEM,4,4
	.comm	MEM_ALIGNMENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
